+1
Z odpowiedzią
Can you round a numerical value as part of an [eval:] statement?
I've got an app the calculates a number, but it will often get a number like 1807.1428571429, etc. Is there a way to tell the [eval:] statement to 2 decimal places (or even to 0)?
Customer support service by UserEcho
For 0 decimals:
[eval:Math.round(2.3333333333)]
For 2 decimals:
[eval:Math.round(2.3333333*100.0)/100.0]
[eval:Math.round(135.3-(30.8*[var:age])+([var:activity]*(10*[var:weight]+934*[var:height]))+25+' calories')]
Thanks, Ian!