Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

minor-unit-label

Latest version: v0.1.0

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
npm package Publisher: chsuchsu96
0 Stars
0 Forks
2 Versions
JavaScript Repo language

Scan summary

minor-unit-label was last scanned on 27 Nov 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 27 Nov 2026.
  • Findings: No rules fired in version 0.1.0.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0 LATEST 27 Nov 2026 No rules fired
0.0.0-stage 27 Nov 2026 Not shown

No rules fired in 0.1.0

Findings

Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Minor Unit Label

Turn amounts stored as whole numbers, such as cents or yen, into currency labels for reports and receipts. The last digit stays accurate even when the amount is too large for a JavaScript number.

What it does

Give the library an integer amount, its currency and the number of decimal places your data source uses. It returns a label using the requested locale. The label keeps exactly that many fraction digits.

Quick start

Run these commands from the directory containing this README. They build the local package and install it into a scratch project.

npm pack
archive="$PWD/minor-unit-label-0.1.0.tgz"
demo_dir="$(mktemp -d)"
cd "$demo_dir"
npm init -y
npm install --offline --no-audit "$archive"
cat > example.cjs <<'EXAMPLE'
const { formatMinorUnits } = require('minor-unit-label');
console.log(formatMinorUnits('9007199254740993', { currency: 'USD', scale: 2 }));
EXAMPLE
node example.cjs

Expected output

$90,071,992,547,409.93

Common examples

formatMinorUnits(1250, { currency: 'JPY', scale: 0 }); // '¥1,250'
formatMinorUnits(-5n, { currency: 'USD', scale: 2 }); // '-$0.05'
formatMinorUnits('2599', { currency: 'EUR', scale: 2, locale: 'de-DE' }); // '25,99\u00a0€'

Use the source's documented scale. For a feed that stores 1234 to mean 12.34, use scale 2 even if the currency normally displays zero decimal places.

API

formatMinorUnits(amount, { currency, scale, locale }) returns a string.

  • amount is a safe JavaScript integer, a bigint of at most 40 decimal digits, or a string containing up to 40 ASCII digits, with an optional leading minus and no leading zeros except for zero itself. Zero displays without a minus.
  • currency is a three-letter ASCII code, case-insensitive.
  • scale is a required integer from 0 to 9. It sets the positions after the decimal in both the source interpretation and the output.
  • locale defaults to en-US and must be an Intl-supported language tag of at most 100 characters. Intl can resolve a tag to a supported parent locale.

The function throws for invalid input, including unsafe numbers and unsupported locales.

Requirements

Node.js 22 or later with Intl locale data. This library has no runtime dependencies.

Security and limitations

The library formats locally. It does not parse formatted labels, convert currencies, compute totals, verify currency membership or enforce payment rules. Handle the result as display text. Symbols, spacing and digits depend on the runtime's locale data.

Troubleshooting

If a digit was already lost while reading a JSON number, send the amount as a JSON string from the data source. Converting the rounded number to a string afterward cannot recover it.

If the decimal point is in the wrong place, check your feed's scale. If your locale is rejected, check the tag and the locale data available in your Node build.

Installation and support

Install the included .tgz archive using npm install --offline --ignore-scripts ./minor-unit-label-0.1.0.tgz from a fresh local project (Node.js 22+). Use the included archive and npx --no-install to avoid downloading a different version.

node -e "console.log(require('minor-unit-label').formatMinorUnits('9007199254740993',{currency:'USD',scale:2}))"

Use synthetic or redacted inputs in bug reports. Optional support: https://buymeacoffee.com/eztoolgo (no entitlement or subscription).

Download and run

Use the versioned download ZIP attached to the corresponding release. Extract the complete archive and open index.html for the local interface and setup steps. No account or subscription is required.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm minor-unit-label

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229