User talk:Wolfganguhr: Difference between revisions
Wolfganguhr (talk | contribs) No edit summary |
Wolfganguhr (talk | contribs) (→Notes) |
||
Line 20: | Line 20: | ||
https://dev.solidcrp.com/wiki/index.php/Restore_the_Petra_Data_Base | https://dev.solidcrp.com/wiki/index.php/Restore_the_Petra_Data_Base | ||
== Else == | |||
=== Getting the correct number of digits === | |||
Actually there is one efficient way to get the information about the maximal precision of a currency. The table a_leder provides the column a_country_code_c. The value in this column shall be used to create a .net [http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx CultureInfo class]. Actually the values are two character codes for example "DE". | |||
try | |||
{ | |||
numberFormatInfo = | |||
new System.Globalization.CultureInfo( | |||
ledger.CountryCode, false).NumberFormat; | |||
} | |||
catch (System.NotSupportedException) | |||
{ | |||
numberFormatInfo = | |||
new System.Globalization.CultureInfo( | |||
String.Empty, false).NumberFormat; | |||
} | |||
If the countryCode is "DE" then the NotSupportedException will be thrown. You really need a code in the syntax <languagecode2>-<country/regioncode2> where the two digits for the language code are based on [http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.name.aspx ISO 639-1 and the regicode is based on ISO 3166]. Then numberFormatInfo.NumberDecimalDigits holds the correct value. | |||
TODO: '''We have to investigate if an automatic conversion of this values may be necessary.''' |
Revision as of 06:36, 21 April 2011
Actual Work
Data Conversion from Petra to Openpetra
Error Messages and Error Messages
Notes
File:Code-overview.JPG
https://dev.solidcrp.com/wiki/index.php/Restore_the_Petra_Data_Base
Else
Getting the correct number of digits
Actually there is one efficient way to get the information about the maximal precision of a currency. The table a_leder provides the column a_country_code_c. The value in this column shall be used to create a .net CultureInfo class. Actually the values are two character codes for example "DE".
try { numberFormatInfo = new System.Globalization.CultureInfo( ledger.CountryCode, false).NumberFormat; } catch (System.NotSupportedException) { numberFormatInfo = new System.Globalization.CultureInfo( String.Empty, false).NumberFormat; }
If the countryCode is "DE" then the NotSupportedException will be thrown. You really need a code in the syntax <languagecode2>-<country/regioncode2> where the two digits for the language code are based on ISO 639-1 and the regicode is based on ISO 3166. Then numberFormatInfo.NumberDecimalDigits holds the correct value.
TODO: We have to investigate if an automatic conversion of this values may be necessary.