An open API service indexing awesome lists of open source software.

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

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)
```