MCPcopy Create free account
hub / github.com/dailydotdev/apps / formatCurrency

Function formatCurrency

packages/shared/src/lib/utils.ts:15–28  ·  view source on GitHub ↗
(
  value: number,
  options?: Intl.NumberFormatOptions,
)

Source from the content-addressed store, hash-verified

13};
14
15export const formatCurrency = (
16 value: number,
17 options?: Intl.NumberFormatOptions,
18): string => {
19 if (typeof value !== 'number') {
20 return '';
21 }
22
23 return value.toLocaleString(['en-US'], {
24 minimumFractionDigits: 2,
25 maximumFractionDigits: 2,
26 ...options,
27 });
28};
29
30export const formatCoresCurrency = (value: number): string => {
31 if (value > 100_000) {

Callers 6

RecruiterSeatsModalFunction · 0.90
ProfileButtonFunction · 0.90
SidebarProfileStatsFunction · 0.90
formatCoresCurrencyFunction · 0.85
PreviewChangesFunction · 0.85
CheckoutChangesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected