MCPcopy Create free account
hub / github.com/josdejong/mathjs / format

Function format

src/utils/string.js:54–61  ·  view source on GitHub ↗
(value, options)

Source from the content-addressed store, hash-verified

52 * @return {string} str
53 */
54export function format (value, options) {
55 const result = _format(value, options)
56 if (options && typeof options === 'object' && 'truncate' in options &&
57 result.length > options.truncate) {
58 return result.substring(0, options.truncate - 3) + '...'
59 }
60 return result
61}
62
63function _format (value, options) {
64 if (typeof value === 'number') {

Callers 2

_formatFunction · 0.90
formatArrayFunction · 0.90

Calls 1

_formatFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…