mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-15 20:06:24 +00:00
12 lines
268 B
TypeScript
12 lines
268 B
TypeScript
|
export const pn = (value?: number | null): string | undefined => {
|
||
|
if (value === null || value === undefined) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
const parts = value.toString().split(".");
|
||
|
|
||
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||
|
|
||
|
return parts.join(".");
|
||
|
};
|