Skip to main content
anitag97364385
Participant
August 8, 2022
Answered

Count up to a value pulled from spreadsheet with decimal numers

  • August 8, 2022
  • 2 replies
  • 182 views

Hi!

 

I created this setup to animate a number counting up to a specific value pulled from a spreadsheet.

I have two text layers: one pulls the data from the spreadsheet, and the other has the counter animation based on the number from the first layer.

Everything is great except that the numbers in the spreadsheet have decimal numbers e.g. 5,15 and the counter rounds the number to 5,00

I imagine this is because After Effects doesn't understand that the text layer is a number with decimals and only reads the number before the comma and that's the value the slider returns.

 

My question is: Is there a way to tell After Effects that that text layer is a number with two decimal spots?

 

And if not is there another way I could make this happen, have an animated counter based on spreadsheet data?

 

Thank's for your help!

 

This topic has been closed for replies.
Correct answer Mylenium

Not AE's fault. You are instructing it to interpret the number as an integer by using parseInt(). That's just how it works. You may want to use parseFloat() instead or simply fetch the string, then convert it to a number. Also convert the comma to a point in Excel before exporting. Commas separate arrays, numbers are delimited by a point.

 

Mylenium

2 replies

Mylenium
MyleniumCorrect answer
Legend
August 8, 2022

Not AE's fault. You are instructing it to interpret the number as an integer by using parseInt(). That's just how it works. You may want to use parseFloat() instead or simply fetch the string, then convert it to a number. Also convert the comma to a point in Excel before exporting. Commas separate arrays, numbers are delimited by a point.

 

Mylenium

anitag97364385
Participant
August 8, 2022

Hi thanks for help, it seems to work with parseFloat()!

anitag97364385
Participant
August 8, 2022