Skip to content
On this page

module nicenum.ts

function niceNum

ts
(range: number, round: boolean) => number

niceNum attempts to find numbers close to range that are pleasing to look at and would make good tick labels. This is mainly to cause domains like [0.00125125, 99.99021] to get mapped to more pleasing alternatives like [0, 100] without impacting accuracy of the interpolation

Parameters

  • range number

    size of domain

  • round boolean

Returns number

Released under the MIT License.