buildo / react-components

Collection of general React components used in buildo projects.
http://react-components.buildo.io/
MIT License
157 stars 21 forks source link

Define precision of measure in Meter component #1453

Closed marcopiii closed 4 years ago

marcopiii commented 4 years ago

As it can be currently verified in the showroom (https://react-components.buildo.io/#meter) the Meter component displays all the significative figures computed as result of props.value / props.max

Schermata 2020-10-06 alle 16 56 07
<FlexView width="100%" column>
  <Meter {...meterProps} min={0} max={3} value={1} />
  <Meter {...meterProps} min={0} max={3} value={2} />
  <Meter {...meterProps} min={0} max={3} value={3} />
</FlexView>;

Since there is no way to avoid this using the current interface, it would be useful to have a prop like precision: Int to define the precision of the fractional part.

marcopiii commented 4 years ago

actually it can be done via labelFormatter prop 🙃