MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / formatNum

Function formatNum

libs/leaflet/leaflet-src.js:128–132  ·  view source on GitHub ↗
(num, precision)

Source from the content-addressed store, hash-verified

126 // The default `precision` value is 6 decimal places.
127 // `false` can be passed to skip any processing (can be useful to avoid round-off errors).
128 function formatNum(num, precision) {
129 if (precision === false) { return num; }
130 var pow = Math.pow(10, precision === undefined ? 6 : precision);
131 return Math.round(num * pow) / pow;
132 }
133
134 // @function trim(str: String): String
135 // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)

Callers 2

leaflet-src.jsFile · 0.85
latLngToCoordsFunction · 0.85

Calls 1

roundMethod · 0.80

Tested by

no test coverage detected