in a formula, how do I make a number always be two...
# suitescript
m
in a formula, how do I make a number always be two decimal places?
z
num.toFixed(2);
m
not in a script. in a netsuite formula, so SQL
z
I think
ROUND(NUM, 2)
does the trick
m
Yeah, that doesnt seem to work of its already an even number
e
Use TO_CHAR(yournumber, '$99,999.99')
m
That works. I was trying to keep it as a number, but cant figure it out
b
As far as numbers are concerned. 1.10 and 1.1 are the same thing
They are different strings, which is why TO_CHAR works
m
well, its a calculated price. I wanted to have it show formatted to 2 decimal places and also be able to use in calculations without converting back to number.
z
you have the field formatted as a currency, right?
sorry, the field type is currency*
m
no..... But that works. I was thinking that wouldnt work since the field value can be blank