Sha256: 9da8a5a2af25ed526ee47b0030e808ce85c2cff7bb536da4c2523baf011658e5
Contents?: true
Size: 407 Bytes
Versions: 69
Compression:
Stored size: 407 Bytes
Contents
define(['../lang/toNumber'], function(toNumber){ /** * Enforce a specific amount of decimal digits and also fix floating * point rounding issues. */ function enforcePrecision(val, nDecimalDigits){ val = toNumber(val); var pow = Math.pow(10, nDecimalDigits); return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); } return enforcePrecision; });
Version data entries
69 entries across 69 versions & 2 rubygems