Hi,
i won´t declare an enum NumberFormat{hundredth, thousandth} with an String value.
Examble:
enum NumberFormat{hundredth = "##0.0#", thousandth= "##0.00#"}
how can i declare this??
Hi,
i won´t declare an enum NumberFormat{hundredth, thousandth} with an String value.
Examble:
enum NumberFormat{hundredth = "##0.0#", thousandth= "##0.00#"}
how can i declare this??
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
AlanPosted Apr 24, 2008, 9:44 AM
You can't declare an enum with string values, only integer values are allowed.
Instead, I'd use a static class (.Net 2.0 or later):
public static class NumberFormat
{
public const string hundredth = "##0.0#";
public const string thousandth = "##0.00#";
}
string format = NumberFormat.hundredth;