Skip to content

To fix the error of the toFixed method not preserving decimal places 修正toFixed方法保留小数位的错误

Notifications You must be signed in to change notification settings

xiahouwei/naive-toFixed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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' damn it! (`Д´*)9

console.log(NaToFixed(a, 2)) // '1.35' got it! ╮( ̄▽ ̄)╭

About

To fix the error of the toFixed method not preserving decimal places 修正toFixed方法保留小数位的错误

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published