1 define(['../lang/toNumber'], function(toNumber){
3 * Enforce a specific amount of decimal digits and also fix floating
4 * point rounding issues.
6 function enforcePrecision(val, nDecimalDigits){
8 var pow = Math.pow(10, nDecimalDigits);
9 return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits);
11 return enforcePrecision;