Skip to content

Latest commit

 

History

History
113 lines (66 loc) · 2.46 KB

File metadata and controls

113 lines (66 loc) · 2.46 KB

number2jsonf

Return a JSON representation of a number.

Usage

var number2jsonf = require( '@stdlib/number/float32/to-json' );

number2jsonf( x )

Returns a JSON representation of a number.

var json = number2jsonf( NaN );
/* returns
    {
        'type': 'float32',
        'value': 'NaN'
    }
*/

Examples

var number2jsonf = require( '@stdlib/number/float32/to-json' );

console.log( number2jsonf( NaN ) );