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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.