baseroo
v2.0.1
Published
Converts positive & negative float values from one base to another between 2-64
Downloads
52
Readme
// Install it with `npm i baseroo`
import { convertBase } from 'baseroo'
const base16Value = '8f.3333333333'
// Works for floating point numbers to a precision of 10 places.
const base10Value = convertBase(base16Value, 16, 10) // '143.1999999999'
Background
Baseroo was created from a 2015 Stack Overflow Answer from a question asking "How do you convert numbers between different bases in JavaScript?". This answer and the Gist code snippet received some comments requesting some changes, so it was converted to a package with tests and documentation in January 2023 to continue its development and make it easier to use as bug fixes and improvements are made.