Author Topic: Formating decimals in PtokaX 0.3.3.0 build 17.02  (Read 1790 times)

0 Members and 1 Guest are viewing this topic.

Offline BossiDeLeon

  • Junior Member
  • **
  • Posts: 12
  • Karma: +0/-0
Formating decimals in PtokaX 0.3.3.0 build 17.02
« on: 31 May, 2005, 03:05:55 »
hey again,

i need to be able to output numbers in a certain decimal format, like say just 2 decimal places. how can this be done with PtokaX 0.3.3.0 build 17.02?

thanks!

PtokaX forum

Formating decimals in PtokaX 0.3.3.0 build 17.02
« on: 31 May, 2005, 03:05:55 »

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 577
  • Karma: +71/-5
(No subject)
« Reply #1 on: 31 May, 2005, 09:37:37 »
Well, if you want two decimal places, try this one:
Code: [Select]
string.format("%0.2f",(x/y))Where "2" means how many decimal places and "x" and "y" are the values.

Cheers

Offline BossiDeLeon

  • Junior Member
  • **
  • Posts: 12
  • Karma: +0/-0
(No subject)
« Reply #2 on: 31 May, 2005, 19:17:59 »
works like a charm!

thanks jiten!

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 577
  • Karma: +71/-5
(No subject)
« Reply #3 on: 31 May, 2005, 21:05:38 »
You're welcome m8.

PtokaX forum

(No subject)
« Reply #3 on: 31 May, 2005, 21:05:38 »