Back to functions

Expression.text


text

Returns the text representation of the expression.

Usage: nerdamer.text(option, n)


Parameters

String option Pass in the string 'decimals' to get back numers as decimals. Pass in the string 'fractions' to get back number as fractions. Defaults to decimals.
String n The number of decimal places if requested as decimal

EXAMPLES:
var x = nerdamer('1/12+1/2*cos(x)-0.5');
console.log(x.text('decimals'));
console.log(x.text('fractions'));
OUTPUT:
Back to functions