public static string CovertPaymentAmountToCardinalCommerceFriendlyString(Decimal
paymentAmount)
{
string decimalAsString = Math.Round(paymentAmount, 2).ToString(new
System.Globalization.CultureInfo("en"));
if (decimalAsString.Contains("."))
{
string[] paymentAmountArray = decimalAsString.Split(".".ToCharArray());
if (paymentAmountArray[1].Length == 1)
{
return paymentAmountArray[0] + paymentAmountArray[1] + "0";
} else {
return paymentAmountArray[0] + paymentAmountArray[1].Substring(0, 2);
}
} else {
return decimalAsString + "00";
}
}
The Spanish stringification would have a comma in it in lieu of a period. :(
No comments:
Post a Comment