Catalog npm
Back to packageRELEASE DETAILS

1.0.3

npm

2dec

Number to string with any number of decimal points

numbers
Published27 Nov 2023
Direct dependencies0
Transitive dependenciesNot calculated

README

Current package documentation

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)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "b54dbd0c8fa2fc6d53085f4fcf8ddedcb2da9554",
  "tarball": "https://registry.npmjs.org/2dec/-/2dec-1.0.3.tgz",
  "fileCount": 5,
  "integrity": "sha512-wiIodEgkbMkrQqlzaupCg9VxxzOd4p4zohOMjs+qlJ+Art6vCA5RZd+ujjUQMtyVI2cief0gwa9XUQIWQZq8Dg==",
  "signatures": [
    {
      "sig": "MEQCIAuj9rnqJ+HcatAtCdOmSGd07EKUnzdB0SxAD3r6I9+wAiAEsN77Z4Ea7CGaAWpB6lrRuUlypaR9Ak1VmUi1S3sN8A==",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 2530
}

Repository

MOVED
robertsspaceindustries/2dec

Shared repository data · GitHub

Repository moved · manual review pending

HTTP 301 · detected 22 Oct 2026

Reported destination
License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:11 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:d0cd0babf60b6c87989158d13685a1f3501b7f3f6dcbf2b42b410416ee4b8ee4

Other collected versions

1.0.710 Aug1.0.63 Jun1.0.529 Jan1.0.416 Dec1.0.3-patch-b6 Dec1.0.3-patch29 NovView all collected versions →