This topic is locked
[SOLVED]

 Round off Decimals

2/4/2014 10:11:13 PM
PHPRunner General questions
P
prab author

Hello Friends,
I am calculating values on the fly the from Add page: JavaScript OnLoad

Like example....

***

var ctrlPrice = Runner.getControl(pageid, 'Price');

var ctrlQuantity = Runner.getControl(pageid, 'Quantity');
var ctrlTotal = Runner.getControl(pageid, 'Total');

function func() {

ctrlTotal.setValue(Number(ctrlPrice.getValue()) * Number(ctrlQuantity.getValue()));

};

ctrlPrice.on('keyup', func);

ctrlQuantity.on('keyup', func);

***
and working fine.



Question is


some of my results are like 42.256398

I wants to round off in 2 decimals like 42.26
Help and Thanks

P
prab author 2/5/2014

Just made my day. I tried to search topic before post but somehow missed it.

Thank you so much