Hi everybody,
I am wondering what is the correct syntax for fomatting integer values in the C# to appear right justfied to predefined number of spaces?
Here is my code
location = (String)row["location"];
onHand = Convert.ToInt32(row["on_hand"]);
displayString.AppendFormat(" {0,-10} {1:N0}{2}", location, onHand, Environment.NewLine);
which is supposed to simulate this VFP code
lvRetVal=lvRetVal+' '+padr(location,10)+' '+transform(on_hand, '999,999,999')+chr(13)+chr(10)
Do you know how should I adjust the above?
I looked at this page in MSDN
http://msdn.microsoft.com/en-us/library/vstudio/system.globalization.numberformatinfo.numbergroupsizes(v=vs.100).aspxbut still don't understand
Thanks a lot in advance.
UPDATE. I figured this out and visually my results look the same, but UnitTest is still failing.
If it's not broken, fix it until it is.
My Blog