[PHP] Punten in getallen

Pagina: 1
Acties:
  • 30 views sinds 30-01-2008

  • Reveller
  • Registratie: Augustus 2002
  • Laatst online: 05-12-2022
Een hele simpele vraag wellicht, maar ik kan er geen antwoord op vinden (noch via GoT Search als Google):
Als ik aan het rekenen ben in PHP, reken ik bijvoorbeeld met "1000" en "10000". Maar als ik deze getallen in leesbare vorm wil weergeven, is "1.000" en "10.000" beter. Met andere woorden: ik wil graag punten om de duizendtallen, etc. te scheiden.

Is hier een standaard PHP functie voor (ik kon op php.net niets vinden) of moet je hiervoor zelf iets bouwen?

"Real software engineers work from 9 to 5, because that is the way the job is described in the formal spec. Working late would feel like using an undocumented external procedure."


Verwijderd

PHP:
1
number_format();

  • Tys
  • Registratie: Januari 2003
  • Laatst online: 01-12 14:22

Tys

My flight statistics: (449.638km in 124 flights) Next trips: Estonia, Latvia, Lithuania


  • Creepy
  • Registratie: Juni 2001
  • Laatst online: 30-11 15:10

Creepy

Tactical Espionage Splatterer

Kom op hoor. Met een beetje googlen moet je dat toch echt wel zelf kunnen vinden. Met termen als "format", "number" en "php" rollen er direct een hoop bruikbare resultaten uit.

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney


Dit topic is gesloten.