baseroo
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

🦘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.

Readme

Keywords

none

Package Sidebar

Install

npm i baseroo

Weekly Downloads

33

Version

2.0.1

License

MIT

Unpacked Size

41.1 kB

Total Files

13

Last publish

Collaborators

  • ryansmith94