I have an enum
public enum ProductionStatus {
Received = 000,
Validated = 010,
PlannedAndConverted = 020,
InProduction = 030,
QAChecked
With Formatting:
((int)ProductionStatus.Validated).ToString("000", CultureInfo.InvariantCulture);
That's short and simple, and it returns a string.
You can factor that into an extension method if you like
public static class ProdStatusExtensions {
public static string (this ProductionStatus status) {
return ((int)status).ToString ("000", CultureInfo.InvariantCulture);
}
}