roojs-all.js
[roojs1] / examples / math.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
4 <title>Array Grid Example</title>
5
6      <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
7     <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
8
9      <script type="text/javascript" src="../roojs-all.js"></script>   
10   
11     <script type="text/javascript" src="../Roo/util/Math.js"></script>
12     
13 </head>
14 <body>
15  <h1>Math utile example</h1>
16 <p>This example shows how to create a grid from Array data.</p>
17 <p>Note that the js is not minified so it is readable. See 
18  
19  <script>
20  
21  Roo.onReady(function() {
22      
23      a = new Roo.util.Math("123.004",5);
24      a  = a.add("334.003");
25      console.log("doing fixed");
26      console.log(a.toFixed(3));
27      console.log(a.toFixed(2));
28      
29      var qty = new Roo.util.Math(3,5)
30  
31     var am = qty.multiply('15.80');
32     console.log(am)
33     console.log(am.toFixed(2))
34     
35     });
36  
37  
38  </script>
39 </div>
40 </body>
41 </html>