deno.land / x / masx200_leetcode_test@10.6.5 / thousand-separator / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
export default function thousandSeparator(n: number): string { const str = [...n.toString()].reverse(); return Array(Math.ceil(str.length / 3)).fill(0).map((_, i) => str.slice(i * 3, i * 3 + 3).reverse().join("") ).reverse().join(".");}
masx200_leetcode_test

Version Info

Tagged at
a year ago