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

1.0.2 • Public • Published

naive-tofixed

To fix the error of the toFixed method not preserving decimal places

修正toFixed方法保留小数位的错误

install

npm install naive-tofixed

import and use

import NaToFixed from 'naive-tofixed'

const a = 1.345

console.log(a.toFixed(2)) // '1.34'

console.log(NaToFixed(a, 2)) // '1.35' got it!

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i naive-tofixed

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

5.09 kB

Total Files

7

Last publish

Collaborators

  • xiahouwei