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!

Readme

Keywords

Package Sidebar

Install

npm i naive-tofixed

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

5.09 kB

Total Files

7

Last publish

Collaborators

  • xiahouwei