https://github.com/rickyvetter/sigfig
An npm module for forcing sigfigs
https://github.com/rickyvetter/sigfig
Last synced: 4 months ago
JSON representation
An npm module for forcing sigfigs
- Host: GitHub
- URL: https://github.com/rickyvetter/sigfig
- Owner: rickyvetter
- License: mit
- Created: 2014-10-08T02:16:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-08T02:42:50.000Z (over 10 years ago)
- Last Synced: 2025-01-10T10:04:26.546Z (5 months ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
sigfig
======An npm module for finding and rounding to sigfigs.
#Use
```
var sigfig = require("sigfig");
``````
/* returns num rounded to the number of sigfigs */
sigfig.roundToSigFigs(num, numOfSigFigs)
``````
/* returns the number of sigfigs in num */
sigfig.findSigFigs(num)
``````
/* returns the result of functionToPerform rounded to the sigfigs of num */
sigfig.keepSigfigs(num, functionToPerform)
```