Hi,
I need to code a number count for the number below.
What’s not working:
- Doesn’t display as the exact number. Only as 53 000 000
- How can I end the number with a “+” sign?
- When website is published, the coding doesn’t display.
Here’s my code below:
let startNum1 = 1000000 ;
let endNum1 = 53000000 ;
const duration1 = 10 ; // 1000 milliseconds
$w . onReady ( function () {
setInterval (()=> {
countUp1 ();
}, duration1 );
});
function countUp1 ( ){
if ( startNum1 <= endNum1 ){
$w ( ‘#text10’ ). text = startNum1 . toLocaleString (). toString ();
startNum1 += 500000 ;
}
}
–––––––––––––
Can anyone help please ?