I am trying to pass a number with 0's, until its 3 or more characters. I've done a not-so-dynamic approach below, but I was wondering if C# had anything built in?
For example, "77" would become "077", "6" would become "006", and "63" would become "063"
Is there a built in / better way?
_totalSupplierCount = GetTotalSupplierNumberForInvoices().ToString().Left<double>(3);
_totalSupplierCountStr = _totalSupplierCount.ToString();
if (_totalSupplierCountStr.Length == 2)
{
_totalSupplierCountStr = "0" + _totalSupplierCountStr;
}
if (_totalSupplierCountStr.Length == 1)
{
_totalSupplierCountStr = "000" + _totalSupplierCountStr;
}