Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put a dot after three digits of a number

Tags:

php

do you know how can i put a dot (.) after 3 digits of a number(starting from the end) in php? example: the number 1254631 to be shown as 1.254.631??

like image 543
Nick Avatar asked Jan 10 '10 21:01

Nick


People also ask

How to add dots in numbers html?

The Unicode and HTML Entities for Bullet Points Then type the 2022 number in, and then add a semi-colon. So, it becomes • . Apart from the • Unicode character, you can also use • and • HTML entitles to show bullets or dot symbols on the web page.


1 Answers

if you want to pretty print a number, number_format is nice

echo number_format(1254631 , 0, ',', '.');  // prints 1.254.631

the last argument is the thousands separator (dot in your case)

like image 200
jspcal Avatar answered Oct 22 '22 09:10

jspcal