stringify-pi
Stringify number values that might be multiples of π.
Usage
var stringifyPi = ;var π = MathPI; ;//=> '3/π' ;//=> 'π/3' ;//=> '2π/3' ;//=> '2π' // works on normal fractions too;//=> '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