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

Function formatUtcOffset

packages/shared/src/features/lfg/lib/format.ts:46–53  ·  view source on GitHub ↗
(offset: number)

Source from the content-addressed store, hash-verified

44
45// Bare offsets everywhere: "UTC+1", "UTC+5:30", "UTC-3".
46export const formatUtcOffset = (offset: number): string => {
47 const hours = Math.trunc(Math.abs(offset));
48 const minutes = Math.round((Math.abs(offset) - hours) * 60);
49
50 return `UTC${offset < 0 ? '-' : '+'}${hours}${
51 minutes ? `:${String(minutes).padStart(2, '0')}` : ''
52 }`;
53};
54
55export const formatLfgReputation = (value: number): string =>
56 `${value.toLocaleString('en-US')}+ reputation`;

Callers 6

getLfgPlaceFunction · 0.90
LfgComposerFunction · 0.90
TimeZoneListFunction · 0.90
LfgTimeZoneFilterFunction · 0.90
LfgReachOutDetailFunction · 0.90
format.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected