FormatFractionContentGenerator

class FormatFractionContentGenerator(numberFormat: Intl.NumberFormat = numberFormat { style = "percent" }) : ContentGenerator<Number>

Uses a Intl.NumberFormat to format the fraction of a value within bounds. E.g. if value = 2, bounds=1,10, then the fraction is 0.2 which is formatted using a given numberFormat.

Parameters

numberFormat

the number format to be used. Defaults to formatting as percentage

Constructors

Link copied to clipboard
constructor(numberFormat: Intl.NumberFormat = numberFormat { style = "percent" })

Functions

Link copied to clipboard
open override fun generateContent(tag: Tag, value: Number, bounds: Bounds<out Number>)