Percent formatting for a cell

Posted by: mserban on 4 July 2018, 10:06 pm EST

    • Post Options:
    • Link

    Posted 4 July 2018, 10:06 pm EST

    Hello,

    I have the following problem: when I input data into a percentage field, spredJS is formatting the number differently than the excel. For example, if I input 5 in excel it will show as 5%; for spreadjs is shown as 500%. I know you could introduce 5% and it will remain like this but this is not how we want it to work.

    Is there any possibility to show the desire format? Maybe to intercept the value and append a ‘%’ or to divide the value by 100 before it is set on cell. I already tried some events like EditEnded and EditEnding but with no success.

    Thank you,

    Mircea

  • Posted 5 July 2018, 1:13 am EST

    Just to be clear, if I input the value 10, I want the text to be 10% and the value 0.1

    For now, spreadjs shows me 1000% and the value is 10.

    Thanks

  • Posted 5 July 2018, 7:44 pm EST

    Hello,

    Please refer to the attached sample application where I have created custom percent celltype which does not change the cell value but puts the ‘%’ format.

    Thanks,

    Deepak SharmaSpreadJSPercentCellTypeWithFormat.zip

  • Posted 5 July 2018, 10:59 pm EST

    Thank you!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels