function roundNumber(num, dec) {
var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
return result;
}
and then write code something like this :
roundNumber(dec_number,2)
As simple as that!
Cheers..
Showing posts with label how round(). Show all posts
Showing posts with label how round(). Show all posts
Subscribe to:
Posts (Atom)
Are legacy 4GL applications keeping you from embracing modern technologies?
As the competitive advantages offered by cloud, mobile, and other new technologies become more apparent, the decision to migrate legacy 4GL ...
-
1. Create a Response window named w_msg with 1 static text and 3 command button. 2. w_msg event open string ls_data,ls_parse inte...
-
Export Datawindow to excel files without dw2xls First, create a global function f_excel(datawindow idw) int li_rtn string xlsname,nama,...
-
1. Create Window, Datawindow and controls 2. Create A sample menu 3. Create window function public function boolean of_extr...