Format Fraction Content Generator
class FormatFractionContentGenerator(numberFormat: Intl.NumberFormat) : ContentGenerator<Number>
Content copied to clipboard
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
FormatFractionContentGenerator
Link copied to clipboard
fun FormatFractionContentGenerator(numberFormat: Intl.NumberFormat = numberFormat {
style = "percent"
})
Content copied to clipboard
the number format to be used.
Functions
generateContent
Link copied to clipboard
open override fun generateContent(tag: Tag, value: Number, bounds: Bounds<out Number>)
Content copied to clipboard