Entering Negative value using ()

Posted by: hghanta on 15 November 2017, 1:52 am EST

    • Post Options:
    • Link

    Posted 15 November 2017, 1:52 am EST

    Excel supports inputting negative numbers using () i.e -100 can be entered using (100). While we are doing the same in spread it is considering as a text (100) rather than a -100. Is there a possibility to read this value as -100 numeric value in spread.

  • Posted 15 November 2017, 10:50 pm EST

    Hello,

    This is the intended behavior of SpreadJS, (100) will be considered as a string and not a number. You can write a function set a negative value using the code as follows:

    
    function makeNegative(yournumber) {
        if (yournumber > 0) {
            yournumber = -yournumber;
        }
    }
    
    

    I hope it helps.

    Thanks,

    Deepak Sharma

  • Posted 19 November 2017, 4:16 pm EST

    Thanks for the solution :wink: I not only need to read the value , but i also want it to be displayed in the control as if negative value is entered in the control.

  • Posted 20 November 2017, 1:28 am EST

    Hello,

    You can set the value format for the cell to number entered is found to be negative , you can set the forecolor of the cell to red. Let me know in case you face any issues implementing the same.

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels