Welcome, Guest
Username: Password: Remember me

TOPIC: End message script I need to round a percentage down to two places

End message script I need to round a percentage down to two places 1 year 5 months ago #95738

  • pksupport
  • pksupport's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 34
  • Thank you received: 1
  • Karma: 0
How can I limit a number to 2 decimal places in this code:

Your percentage for Knowledge and skills was:{sum(that.A01.value, that.A06.value, that.A07.value, that.A08.value, that.A12.value, that.A15.value) / 60 * 100} %

Thanks for your time - it's much appreciated.
The administrator has disabled public write access.

End message script I need to round a percentage down to two places 1 year 4 months ago #96857

  • pksupport
  • pksupport's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 34
  • Thank you received: 1
  • Karma: 0
:( Please!! I have been working hard on this. I can use {floor} but I can't get this to work as I have posted and I need it! Can I pay someone?
The administrator has disabled public write access.

End message script I need to round a percentage down to two places 1 year 4 months ago #96873

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1125
  • Thank you received: 259
  • Karma: 79
Not tried, but probably something like this:
{round(sum(that.A01.value, that.A06.value, that.A07.value, that.A08.value, that.A12.value, that.A15.value) / 60 * 100),2}
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: pksupport

End message script I need to round a percentage down to two places 1 year 4 months ago #96894

  • pksupport
  • pksupport's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 34
  • Thank you received: 1
  • Karma: 0
THANK YOU!! :cheer:

{round(sum(that.A01.value, that.A06.value, that.A07.value, that.A08.value, that.A12.value, that.A15.value) / 60 * 100),2}

I took off the 2 at the end - was this places? It works. Very very happy as I spent a lot of time on this, so again, thank you very much.

Solution to round down a summed value:

{round(sum(that.A01.value, that.A06.value, that.A07.value, that.A08.value, that.A12.value, that.A15.value) / 60 * 100)}
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.143 seconds
Donation Image