Again, I've nothing standard, this works as far as I've tested (assumes fixed width padding):
var cultureInfo = new System.Globalization.CultureInfo("nl-NL");
var numberFormatProvider = cultureInfo.NumberFormat;
var chars = theumber.ToString("0000,0000,000,000.#####", numberFormatProvider).ToCharArray();
for (int i=0; i< chars.Length; i++)
{
if(chars[i]=='.' || chars[i]==',' )
continue;
if(chars[i] != '0')
break;
chars[i] = '*';
}
string paddedText = new string(chars);
Could do with some refactoring though - has magic strings for the separtors (come can be got from
cultureInfo.NumberFormat
) and doesn't handle negatives at the very least. I'd also abstract out to en extension method.