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

separator is not working

Open tutv opened this issue 9 years ago • 4 comments

 <CountUp className="CountUp"
                     suffix="+"
                     separator=" "
                     decimals={4}
                     decimal=","
                     start={0} end={total}/>
//Result: 912800,0000+
//Expected: 912 800,0000+

tutv avatar Oct 25 '17 03:10 tutv

Hey!

separator only works with useGrouping:

 <CountUp className="CountUp"
                     useGrouping
                     suffix="+"
                     separator=" "
                     decimals={4}
                     decimal=","
                     start={0} end={total}/>

See a live example here https://codesandbox.io/s/lrpz51mk9

glennreyes avatar Oct 25 '17 15:10 glennreyes

👍 Thanks. It's working now :)

tutv avatar Oct 26 '17 03:10 tutv

But I think when separator is not empty, component CoutuUp will auto detect useGrouping

tutv avatar Oct 26 '17 03:10 tutv

Yeah seems like a good idea to add this behaviour. Would you mind to open a PR?

PS: if you set useGrouping only, a default value of separator will be used.

glennreyes avatar Oct 26 '17 07:10 glennreyes