Skip to content

Display of float values #7

@sandtreader

Description

@sandtreader

Hi,

Love this, neat, simple and the default style is perfect for a dark dashboard!

One request - it's hard to get it to show floating point values in the indicator at the moment, because even if you override the children it gets passed fixedValue, not value, and this is rounded to integer here:

https://github.com/lucassaid/react-speedometer/blob/main/src/Indicator.tsx#L33

I've had to fool it by setting value to n*100 and overriding the indicator to display (parseFloat(value)/100), and fudging the marks too, but it would be nice if you could set the decimal places (to pass to toFixed), which would save having to override it at all.

Thanks!

Paul

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions