Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 258290

Re: Padd string with zeroes

$
0
0

Just after posting I stumbled across this function that works. It may not be the best way or most efficient, but it works and we're happy with that.

 

functionZeroPadNumber( nValue )
{
  
if( nValue <10)
  
{
  
return('000'+ nValue.toString ());
  
}
  
elseif( nValue <100)
  
{
  
return('00'+ nValue.toString ());
  
}
  
elseif( nValue <1000)
  
{
  
return('0'+ nValue.toString ());
  
}
  
else
  
{
  
return( nValue );
  
}
}


Viewing all articles
Browse latest Browse all 258290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>