2

I am trying to design a progress bar and I want to try to set the width of the bar depending on some mathematical calculations.

Below is working fine, since I am hardcoding the width to 60%

.pledged(style="width:60%")

I want to do something like this:

.pledged(style="width:((totalVotes - votesRemaining)*100)%")

Is it possible what I am trying to achieve?

Brig
  • 10,211
  • 12
  • 47
  • 71
Prashant
  • 23
  • 4

1 Answers1

3

Be sure to add #{} to get access to your variables:

.pledged(style="width:#{totalVotes - votesRemaining)*100}%")
Brig
  • 10,211
  • 12
  • 47
  • 71