3.1.4 • Published 7 years ago
get-pi v3.1.4
Get Pi
Git repository for get-pi npm module https://www.npmjs.com/package/get-pi
A small library that returns the requested digits of Pi (π). The return pseudo-type is according to the request.
- Int if only decimals are quested (default) AND number of digits requested is less than 17.
- Float if only decimals are quested (default) AND number of digits requested is less than 17.
- String if explicitly requested OR number of digits requested is less than 17.
Supported commands:
.getPi(<digits - optional>, <decimalsOnly - optional>)
(returns digits digits of Pi (default = 4), starting counting after the decimal. i.e. for n=1 returns 1).getPiString(<digits - optional>, <decimalsOnly - optional>)
(returns a String with digits digits of Pi (default = 4), starting counting after the decimal. i.e. for n=1 returns 1)
Installation
npm install get-pi
Usage
var gip = require('get-pi');
var numIndex = gip.getPi();
Output should be 3.1416
NOTES
Rounding on the last digit occurs ONLY when returning _Float_
Tests
TODO
Contributing
...is welcome :)
3.1.4
7 years ago