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.

1

1 Answer 1

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 and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.