stringify-pi
Stringify number values that might be multiples of π
Last updated 9 years ago by james.talmage .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install stringify-pi 
SYNC missed versions from official npm registry.

stringify-pi

Stringify number values that might be multiples of π.

Build Status Coverage Status Code Climate Dependency Status devDependency Status

NPM

Usage

var stringifyPi = require('stringify-pi');
var π = Math.PI;

stringifyPi(3 / π);
//=> '3/π'

stringifyPi(π / 3);
//=> 'π/3'

stringifyPi(2 * π / 3);
//=> '2π/3'

stringifyPi(2 * π);
//=> '2π'

// works on normal fractions too
stringifyPi(2/3);
//=> '2/3'

API

stringifyPi(input)

input

Required Type: number

A number that might be a (fractional) multiple of π.

returns

A String representation of the input. If a reasonable estimation of a fractional value or fractional multiple of π can be found, the string will contain the π character.

License

MIT © James Talmage

Current Tags

  • 0.0.3                                ...           latest (9 years ago)

3 Versions

  • 0.0.3                                ...           9 years ago
  • 0.0.2                                ...           9 years ago
  • 0.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (5)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE