how to add 2 Decimals in a calculated field

Can someone please show how we need to add a decimal in a calculated field in a grid e.g
one column is price the other quantity the total automatically calculates but needs a decimal place.

hi

use this , your gridobject.MathRound(2);

if you want to get two decimal places , if suppose if you want more than two , the value will be increasing depends upon your requirement.

thank you surya i have implemented it using :

grid.setNumberFormat(“0.00”,9); //put 2 decimal in price column
grid.setNumberFormat(“0.00”,10); //put 2 decimal in total column

below is my columns :

grid.setColTypes(“ro,ro,ed,ed,ro,ro,ro,ro,ro,edn,edn[=c8*c9]”);

where the last field is the calculated that i needed to put into two decimal places.

hi mattoce,

there is no need to set that number format , once you set your column types then immediately implement mygrid.MathRound(2);

it’s enough , you will get it …