|  | 
| Leading zero in format ignored? | 
| Post Reply   | 
| Author | |
| RobinG   Groupie   Joined: 07 May 2006 Location: United Kingdom Status: Offline Points: 16 |  Post Options  Thanks(0)  Quote  Reply  Topic: Leading zero in format ignored? Posted: 20 September 2006 at 12:03pm | 
| Hi Im using the proprty grid to display prices, so I request formatting to two decimal places with the example below: Dim i As XtremePropertyGrid.PropertyGridItemDouble Set i = PropCategory.AddChildItem(PropertyItemDouble, COL_HDR_PRICING_RETAIL, 0) i.Id = 1 + COL_POS_PRICING_RETAIL i.Format = "%0.02f" The problem is, that if the data is 2.00 - the propery grid show it as "2" not "2.00" like i want, if data is 2.34, then it correctly shows "2.34" - basically, the leading zero is not working. The documentation doesnt say its possible, but I figured its "standard" printf() formatting but unfortunatly it does work - is there any way to achive this? Im using 9.81 (still...!) | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  Posted: 20 September 2006 at 1:47pm | 
| 
   Try set 
 i.UseSystemDecimalSymbol = False | |
| 
     Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS | |
|  | |
| Miles   Newbie   Joined: 05 January 2011 Status: Offline Points: 1 |  Post Options  Thanks(0)  Quote  Reply  Posted: 05 January 2011 at 1:52am | 
| 
   Is there a workaround to this? I need to use Format = "%01.03f" to force three 0's after the decimal separator (e.g. 33.000), but I also need to set UseSystemDecimalSymbol = True to support international locales where they use comma as the decimal separator. It seems that you still need so set UseSystemDecimalSeparator = False. Thanks!
    | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |