How to use the numbro.format function in numbro

To help you get started, we’ve selected a few numbro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bokeh / bokeh / bokehjs / src / lib / models / formatters / numeral_tick_formatter.ts View on Github external
    return ticks.map((tick) => Numbro.format(tick, format, language, _rounding_fn))
  }
github bokeh / bokeh / bokehjs / src / lib / models / widgets / tables / cell_formatters.ts View on Github external
doFormat(row: any, cell: any, value: any, columnDef: any, dataContext: any): string {
    const {format, language} = this
    const rounding = (() => {
      switch (this.rounding) {
        case "round": case "nearest":   return Math.round
        case "floor": case "rounddown": return Math.floor
        case "ceil":  case "roundup":   return Math.ceil
      }
    })()
    value = Numbro.format(value, format, language, rounding)
    return super.doFormat(row, cell, value, columnDef, dataContext)
  }
}
github bokeh / bokeh / bokehjs / src / lib / core / util / templating.ts View on Github external
  numeral:  (value: string | number, format: string, _special_vars: Vars) => Numbro.format(value, format),
  datetime: (value: unknown, format: string, _special_vars: Vars) => tz(value, format),
github bokeh / bokeh / bokehjs / src / coffee / models / widgets / slider.ts View on Github external
protected _formatter(value: number, format: string): string {
    return numbro.format(value, format)
  }
}
github bokeh / bokeh / bokehjs / src / lib / models / widgets / range_slider.ts View on Github external
protected _formatter(value: number, format: string): string {
    return numbro.format(value, format)
  }
}
github bokeh / bokeh / bokehjs / src / coffee / models / widgets / range_slider.ts View on Github external
protected _formatter(value: number, format: string): string {
    return numbro.format(value, format)
  }
}
github bokeh / bokeh / bokehjs / src / lib / models / widgets / slider.ts View on Github external
protected _formatter(value: number, format: string): string {
    return numbro.format(value, format)
  }
}
github bokeh / bokeh / bokehjs / src / coffee / models / widgets / tables / cell_formatters.ts View on Github external
doFormat(row: any, cell: any, value: any, columnDef: any, dataContext: any): string {
    const {format, language} = this
    const rounding = (() => { switch (this.rounding) {
      case "round": case "nearest":   return Math.round
      case "floor": case "rounddown": return Math.floor
      case "ceil":  case "roundup":   return Math.ceil
    } })()
    value = Numbro.format(value, format, language, rounding)
    return super.doFormat(row, cell, value, columnDef, dataContext)
  }
}