Click here to Skip to main content
14,575,520 members
Rate this:
Please Sign up or sign in to vote.
See more:
i want to
interger number convert indian currency with decimal amountlakh,crore,thousand


e.g Example:-

Interger number amount :- 7854785

Thousands :- 7854.785

Lakhs :- 78.54785

What I have tried:

i want to <pre>interger number convert indian currency with decimal 
 lakh,crore,thousand
Posted
Updated 16-May-18 21:08pm
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

The simplest solution is use division;
double result = (double)7854785 / (double)1000 // result = 7854.785
double result = (double)7854785 / (double)100000 // result = 78.54785


When using division in C# the value will be returned based on the datatypes of the values - not the variable type, adding (double) prior to the values casts the values as double prior to performing the division

Kind Regards
   
Comments
Nishant.Chauhan80 17-May-18 3:21am
   
thanku sir
Rate this:
Please Sign up or sign in to vote.

Solution 3

   
Rate this:
Please Sign up or sign in to vote.

Solution 1

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100