+1
Answered

How do you force a calculator to always have two digits after the decimal?

Gruckman 7 years ago updated by icahill (Administrator) 7 years ago 5
You could use an eval for your total after it is calculated. If it were limited to 2 decimal spots, it would round. The eval would look like this:


<text name="Test-7" width="100%" height="100" color="#ffffff" font="Arial" size="48" align="center" alignment="center" text="Limit to 2 Decimals of 34.55555555 is [eval:34.55555555.toFixed(2)]"></text>



OR use a variable
[eval:[var:total].toFixed(2)]
How do you make 1.1 appear as 1.10?
This will force a number to always be stuck at a certain length.

<text name="Test-7" width="100%" height="100" color="#ffffff" font="Arial" size="48" align="center" alignment="center" text="Math Precision of 1.1 is [eval:1.1.toPrecision(3)]"></text>
This solution isn't perfect though as you could have some numbers that are larger. Here is a link to some javascript functions:http://www.merlyn.demon.co.uk/js-math...

You should be able to find one or a combination that will do what you need. This may require that you upload your own custom functions.html file. Check out this tutorial: https://studio.rarewire.com/wordpress...
How do you make 1.1 appear as 1.10?