Hello Everyone,
I'm looking for a way to convert a Double like 1.200 to a text "One Thousand Two Hundred".
Is it possible? I know its possible in excell but how to do in C#
Hello Everyone,
I'm looking for a way to convert a Double like 1.200 to a text "One Thousand Two Hundred".
Is it possible? I know its possible in excell but how to do in C#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Sep 13, 2023, 9:47 AM
Hi Martin,
https://www.aspdotnet-suresh.com/2014/08/aspnet-convert-numbers-to-words-string-in-csharp.html
http://www.softwareandfinance.com/CSharp/Number_To_Text.html
https://interviewsansar.com/program-to-convert-number-to-words-in-csharp/
Jayraj ChhayaPosted Dec 22, 2023, 6:09 AM
In C#, there is no built-in method to directly convert a
Doublevalue to its textual representation in words. However, you can achieve this by breaking down the number into its individual parts (thousands, hundreds, tens, and units) and then converting each part to its corresponding word representation.Here's an example of how you can accomplish this using C#:
You can use the
ConvertDoubleToTextmethod to convert aDoublevalue to its textual representation. For example:Please note that this implementation is limited to converting numbers up to billions. You can modify it to support larger numbers if needed.
I hope this helps! Let me know if you have any further questions.
Anandu G NathPosted Dec 21, 2023, 6:14 AM
Use the below Function
Mohammad HussainPosted Sep 14, 2023, 7:03 AM
Amit MohantyPosted Sep 13, 2023, 10:09 AM
This is not the perfact solutions, but it will work for you:
Rajeesh MenothPosted Sep 13, 2023, 9:24 AM
Hi,
An article on the same topic was authored by a member of the C# Corner community - https://www.c-sharpcorner.com/blogs/convert-number-to-words-in-c-sharp
Similar thread in Stack Overflow - https://stackoverflow.com/questions/2729752/converting-numbers-in-to-words-c-sharp