double alignment using string.format
I was trying to align doubles using string.format and display them on a tooltip.
I used: string.Format("{0,15:N2}", number);
but the results come out as:
1234.56 00.00
It seems some of the numbers are narrower t开发者_如何学Gohan the space. Does anyone know how to solve this problem?
Thanks!
Use a fixed-width font such as Courier New or Consolas if you want all the individual digits to line up.
精彩评论