1

I have a query of MySQL like this-

SELECT avg('total_cost') FROM 'employee'

And then I am getting output like this-

1254589687.26587952

But I like to have a output like this-

1,25,45,89,687.26

So, a comma separator should be added and number should be rounded.

Is there any way in MySQL?

Thanks for helping.

S M Abrar Jahin
  • 113
  • 1
  • 5

1 Answers1

4
+----------------------------------+
| format(123456789.26, 2, 'ta_in') |
+----------------------------------+
| 12,34,56,789.26                  |
+----------------------------------+

http://dev.mysql.com/doc/refman/5.6/en/string-functions.html#function_format
http://dev.mysql.com/doc/refman/5.6/en/locale-support.html -- locales

Rick James
  • 80,479
  • 5
  • 52
  • 119