Counter decimal number

4 replies · opened May 20, 2019

Wweb75May 20, 2019

Hi,
I need to enter the decimal numbers on the counter.
If I put the period or the comma does not work. What should I change?
Thank you!


							
							Hours Spent
						
SSemicolon WebSTAFFMay 20, 2019

Hello,

This is Definitely Possible but requires some Customization in the js/functions.js File. Find the following code:

value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ',');

and replace it with:

value = value.replace(/\B(?=(\d{2})+(?!\d))/g, '.');

Then use the following HTML Code:

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Wweb75May 21, 2019

Perfect thanks, it works.
But I can only do tens of euros with cents. If I also enter the hundreds of euros example 170,20 the counter shows 1,70,22.
Do you have tens and hundreds? Thanks, good job

SSemicolon WebSTAFFMay 21, 2019

Hello,

Okay we have checked more on this and there is already an inbuilt function to implement this. Please consider reverting back to the old codes and then simply add the data-decimals="2" Attribute to the .counter Element. Example:

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Wweb75May 22, 2019

Fantastik, work!!
Thanks

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard