MCPcopy
hub / github.com/koodo-reader/koodo-reader / numberToString

Function numberToString

public/lib/pdfjs/pdf.worker.mjs:6039–6051  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

6037 return null;
6038}
6039function numberToString(value) {
6040 if (Number.isInteger(value)) {
6041 return value.toString();
6042 }
6043 const roundedValue = Math.round(value * 100);
6044 if (roundedValue % 100 === 0) {
6045 return (roundedValue / 100).toString();
6046 }
6047 if (roundedValue % 10 === 0) {
6048 return value.toFixed(1);
6049 }
6050 return value.toFixed(2);
6051}
6052function getNewAnnotationsMap(annotationStorage) {
6053 if (!annotationStorage) {
6054 return null;

Callers 12

getPdfColorFunction · 0.85
createAppearanceMethod · 0.85
writeValueFunction · 0.85
_getAppearanceMethod · 0.85
_renderTextMethod · 0.85
_getCombAppearanceMethod · 0.85

Calls 2

roundMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected