qsu
Version:
qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.
1 lines • 289 B
JavaScript
export function numberFormat(t){if(null==t)return"";const r="string"==typeof t?t:t.toString(),n=r.startsWith("-"),e=(n?r.slice(1):r).split("."),i=`${new Intl.NumberFormat("en-US",{roundingPriority:"morePrecision"}).format(parseInt(e[0],10))}${e.length>1?`.${e[1]}`:""}`;return n?`-${i}`:i}