Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: 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 Jahr 3 Monate her #95738

  • pksupport
  • pksupports Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 32
  • Dank erhalten: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

End message script I need to round a percentage down to two places 1 Jahr 2 Monate her #96857

  • pksupport
  • pksupports Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 32
  • Dank erhalten: 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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

End message script I need to round a percentage down to two places 1 Jahr 2 Monate her #96873

  • Ben_V
  • Ben_Vs Avatar
  • OFFLINE
  • Platinum Lime
  • Beiträge: 1068
  • Dank erhalten: 235
  • Karma: 74
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...
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: pksupport

End message script I need to round a percentage down to two places 1 Jahr 2 Monate her #96894

  • pksupport
  • pksupports Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 32
  • Dank erhalten: 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)}
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.173 Sekunden
Donation Image