Follow

Forcing Decimals on Calculation Fields (Advanced)

By default, Calculation fields will shorten any decimals that have "0" on the end of a number. 

If your value is: "1.20"

It will shorten it to: 1.2

Sometimes however, you will want to force it to display the "0" at the end.

To do this we are going to have to use the "toFixed()" method.

Note: For Android devices you are required to put a character in front of the result in order for it to be left as a string and keep the decimals (see example 2)

 

Example 1 

var example = decimal($numeric_1$,0);

example = example.toFixed(2);

return example;

 

Example 2 

var example = decimal($numeric_1$,0);

example = example.toFixed(2);

return "$ " + example ;

 

 

Have more questions? Submit a request

Comments

Powered by Zendesk