Convert Amount Into Words
https://www.aspsnippets.com/questions/118917/Convert-amount-into-words-Dollars-and-cents-in-ASPNet/ protected void ConvertToWords ( object sender, EventArgs e ) { lblResult.Text = MoneyToWords(Convert.ToDouble(txtAmount.Text)); } public static string MoneyToWords ( double value ) { decimal money = Math.Round(( decimal ) value , 2 ); int number = ( int )money; int decimalValue = 0 ; string doller = string .Empty; string cents = string .Empty; doller = NumberToWords(number); if (money.ToString().Contains( "." )) { decimalValue = int .Parse(money.ToString().Split( '.' )[ 1 ]); cents = NumberToWords(decimalValue); } string result = ! string .IsNullOrEmpty(cents) ? (decimalValue == 1 ? string .Format( "{0} Doller and {1} Cent Only." , doller, cents) : string .Format( "{0} Doller and {1} Cents Only." , doller, cents)) : string .Format( "{0} Doller Only." , doller); ...