1.0.7 • Published 11 months ago

2dec v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

2dec

Lightweight library to convert numbers into strings with decimal points

Usage

import todec from "2dec";

// Basic functionality
todec(8866.51); // Expected result: 8,866.51
todec(10.5); // Expected result: 10.50

// More decimal points (defaults to 2 using logical disjunction)
todec(6.862, 2); // Expected result: 6.86
todec(6.862, 3); // Expected result: 6.862
todec(5324.819, 3); // Expected result: 5,324.819

// Locale (defaults to en-us using logical disjunction)
todec(123456.789, 2, "ar-EG"); // Expected result: ١٢٣٬٤٥٦٫٧٩ (123,456.79)
1.0.7

11 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3-patch-b

2 years ago

1.0.3-patch

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1-c

2 years ago

1.0.1-b

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago