-
Double format Decimal
I have a web based application that allows people to add an amount and right after the port it converts the amount from double to integer. I modified the backend database field amount to double and tested the amount by entering numbers such as 10.15 and 10.75 and hold the information correctly. But when I go onto the site and add an amount similar to the one above for example 10.15 it will rounded to the nearest dollar 10. If I enter 10.75 it will convert to 11.
Your help will be greatly appreciated.
Code:
if (this.DataSource.BalanceSpecified) {
string formattedValue = this.DataSource.Format(TblPaymentRequestTable.Balance);
this.Balance.Text = formattedValue;
} else {
this.Balance.Text = TblPaymentRequestTable.Balance.Format(TblPaymentRequestTable.Balance.DefaultValue);
}