Hello
On the server side the correct currency rounding actually wors:
/// <summary>
/// CurrencyInfo supports two currencies and the conversion rules incluing the
/// rouding based on
/// </summary>
[Test]
public void Test_05_TCurrencyInfo_2()
{
TCurrencyInfo getCurrencyInfo = new TCurrencyInfo("EUR", "JPY");
Assert.AreEqual(1.23m, getCurrencyInfo.RoundBaseCurrencyValue(1.23456m), "Round to 2 digits");
Assert.AreEqual(1.0m, getCurrencyInfo.RoundForeignCurrencyValue(1.23456m), "Round to 0 digits");
decimal exchangeRate = 1 / 119.7295m;
Assert.AreEqual(0.84m, getCurrencyInfo.ToBaseValue(100.00m, exchangeRate),
"Conversion from 100 YEN to 0.83 EUR");
Assert.AreEqual(11973, getCurrencyInfo.ToForeignValue(100.00m, exchangeRate),
"Conversion from 100 EUR to 11983 YEN");
Assert.AreEqual(120, getCurrencyInfo.ToForeignValue(1.00m, exchangeRate),
"Conversion from 1 EUR to 120 YEN");
getCurrencyInfo.ForeignCurrencyCode = "GBP"; // Change foreign Currency to Pound ...
exchangeRate = 1 / 0.8801m;
Assert.AreEqual(113.62m, getCurrencyInfo.ToBaseValue(100.00m, exchangeRate),
"Conversion from 100 GBP to 113.62 EUR");
Assert.AreEqual(88.01m, getCurrencyInfo.ToForeignValue(100.00m, exchangeRate),
"Conversion from 100 EUR to 88.01 GBP");
}
In this case TCurrencyInfo reads the complete a_currency table and interpretes the a_display_format_c column. In order to do a correct reporting I need the same routine on the client side.
Any ideas?
Best regards
Wolfgang