-2

i have integer numbers like below on left side in a file for products and need to convert them into brazilaian format like on right side.

  • 100 =>100,00
  • 84 => 84,00
  • 1011 => 1.011,00
Chethu
  • 555
  • 4
  • 13
  • In which of the numerous languages that you've specified would you like to do this? It looks like the two answers have assumed PHP - is that correct? – Tom Fenech Jul 06 '15 at 11:36
  • Actually i want in gawk , but i mention other languages as if someone writes a function and use that in whichever i want. – Chethu Jul 06 '15 at 11:53

1 Answers1

1

Use number_format() -

echo number_format(100, 2, ',', '.');
echo number_format(84, 2, ',', '.');
echo number_format(1011, 2, ',', '.');

Output -

100,00
84,00
1.011,00

Docs

Sougata Bose
  • 31,517
  • 8
  • 49
  • 87