mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
25 lines
413 B
JavaScript
25 lines
413 B
JavaScript
import { createBaseFormatterFactory } from './baseUtils.js'
|
|
|
|
/**
|
|
* Format a number as octal.
|
|
*
|
|
* Syntax:
|
|
*
|
|
* math.oct(value)
|
|
*
|
|
* Examples:
|
|
*
|
|
* //the following outputs "0o70"
|
|
* math.oct(56)
|
|
*
|
|
* See also:
|
|
*
|
|
* bin
|
|
* hex
|
|
*
|
|
* @param {number} value Value to be stringified
|
|
* @return {string} The formatted value
|
|
*/
|
|
|
|
export const createOct = createBaseFormatterFactory('oct', 8)
|