I have a long amount values and I need to convert those in short format.IF 15000, Then 15 Thousand.
IF 1450000, Then 1.45 million.
and so on...
Kindly let me know the simple ways to achieve this.
Thanks Eduardo,
I did the same, But looking for any other better option if available.
Or please correct/modify If you found anything wrong in below code:
If(Value > 1000000000000, Round( (Value/1000000000000), 2 ) + " Trillion", If(Value > 1000000000, Round( (Value/1000000000),2 ) + " Billion", If(Value > 1000000, Round( (Value/1000000),2 ) + " Million", If(Value > 1000, Round( (Value/1000),2 ) + " Thousand", Value ) ) ) )
The simplest way is to write a function that receives the value and returns the correct text formatted, based on a switch or series of IFs where you compare the size of number starting from the biggest size.
Cheers
Don't think there are any other way...
And your code seems corrrect.
Cheera
The examples I came across do exactly the same.
https://stackoverflow.com/questions/2729752/converting-numbers-in-to-words-c-sharp