JSPM

get-pi

3.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q25018F
  • License BSD-2-Clause

Get Pi (3.14) digits

Package Exports

  • get-pi

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-pi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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