There are a couple of ways to take care of this - through cell formatting and through the TEXT
conversion formula. Cell formatting allows more flexibility for working with the number after it is converted to the format, but it might not be suitable in every case.
For your example as a formula, try this:
=TEXT(A1,"[<-9999999](##\,##\,##\,##0);[<-99999](##\,##\,##0);##,##0")
To do it with formatting, use Format Cells... from the destination cells' context menu, change the Number category to Custom, and put:
[<-9999999](##\,##\,##\,##0);[<-99999](##\,##\,##0);##,##0
in the Type field.
You may need to adjust the formatting string if you need to support decimals.
This site has more examples which may help you: https://exertia.wordpress.com/2006/04/23/displaying-lakhs-and-crores-in-excel/