react-countup icon indicating copy to clipboard operation
react-countup copied to clipboard

Amount being Rounded

Open Samuel-Montoya opened this issue 7 years ago • 1 comments

Hi There,

I am currently having an issue where the formatting function is returning a rounded up number.

I have a pricing point at 17.99, starting at 0. When putting 17.99 as the end property, it returns $18.00.

I can't seem to find where this is happening, or a property to disable this. The formattingFn didn't seem to help either, as the parameter returns the rounded up value.

My CountUp Render: <CountUp delay={1} start={0} end={17.99} decimals={1} duration={2} useEasing={true} />

Thanks for the help!

Samuel-Montoya avatar Jun 07 '19 17:06 Samuel-Montoya

Fixed this by chancing the decimals property to 2 instead of 1.

Samuel-Montoya avatar Jun 07 '19 17:06 Samuel-Montoya