display number with two decimals only if not interger
Hello,
I'm doing some operations with numbers and I want to display the final value in a text field as:
if the number is integer without decimals 100;200;32;15 etc
if the number is not integer with two decimals. 99.12; 23.11 etc
Now I'm using
this.getField("textfield").value=Number(result).toFixed(2);
but it always displays decimals - like 100.00 etc.
Is there a function or format setting to accomplish this?
Thank you very much.
