Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.82 KB

readme.md

File metadata and controls

25 lines (20 loc) · 1.82 KB

🦘
baseroo

Converts positive & negative float values from one base to another between 2-64

License: MIT Uses Semantic Release to correctly bump versions especially for breaking changes Uses Renovate to keep dependencies updated Main branch coverage percentage from Codecov Package size from BundlePhobia
// 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.