W
William Stacey [MVP]
If val is a long, what is the String format conversion of this in c#? TIA!
sprintf(retbuf,"%d.%.2d", val/100, val%100);
sprintf(retbuf,"%d.%.2d", val/100, val%100);
Hi,
Without a regular expression, it could look like this
retbuf = Math.Abs(val/100) + "." + val%100;
But this will give the same result
retbuf = Math.Round((decimal)val/100,2).ToString();
Good Luck
Adnan
William said:If val is a long, what is the String format conversion of this in c#? TIA!
sprintf(retbuf,"%d.%.2d", val/100, val%100);
mikeb said:Something like:
retbuf = String.Format( "{0}.{1:00}", val/100, val%100);