NOTICE: Our Community is moving. Get more information.
In .Net how can COBOL find out the regional settings that are currently in use for a class.
The .Net Framework provides the class System.Globalization.CultureInfo that allows you to obtain regional characteristics.
Some sample code that uses this class is:-
program-id. Program1 as "CurrentCulture.Program1".
01 Cult type CultureInfo.
***** Obtan the Culture Information from the Current Thread
set Cult to type CultureInfo::CurrentCulture
***** Display some Values from the Culture Class
display "Current Locale= " Cult::EnglishName
display "Current Date and Time Format = " Cult::DateTimeFormat::FullDateTimePattern
display "Currency Symbol = " Cult::NumberFormat::CurrencySymbol
display "Decimal Indicator = " Cult::NumberFormat::NumberDecimalSeparator
end program Program1.