
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
number-converter
Advanced tools
A Node.js library for converting between different numeric representations.
var NumberConverter = require("number-converter").NumberConverter;
var nc = new NumberConverter(NumberConverter.DECIMAL, NumberConverter.ROMAN_NUMERAL);
console.log(nc.convert(1234)); // MCCXXXIV
console.log(nc.deconvert("MCMXCIX")); // 1999
A NumberConverter can convert between different numeric representations specified in its constructor. To convert between hexadecimal and binary, write:
var nc = new NumberConverter(NumberConverter.HEXADECIMAL, NumberConverter.BINARY);
console.log(nc.convert("F8F")); // "111110001111"
Here are the available number types:
NumberConverter.DECIMAL
- Base-10 number system (digits 0-9)NumberConverter.BINARY
- Base-2 number system (digits 0 and 1)NumberConverter.OCTAL
- Base-8 number system (digits 0-7)NumberConverter.HEXADECIMAL
- Base-16 number system (digits 0-9 and letters A-F)NumberConverter.ROMAN_NUMERAL
- Numeric system used in ancient Rome (letters I, V, X, L, C, D and M)NumberConverter.SCIENTIFIC_NOTATION
- Scientific notation: a way of writing numbers too large or small to be conveniently written as decimal (e.g. 5200000 -> 5.2e6)To use number-converter in your Node.js project, run:
npm install number-converter --save
FAQs
Converts numbers between various formats
The npm package number-converter receives a total of 0 weekly downloads. As such, number-converter popularity was classified as not popular.
We found that number-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.