Print Page | Close Window

Leading zero in format ignored?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=5106
Printed Date: 22 June 2024 at 6:46am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Leading zero in format ignored?
Posted By: RobinG
Subject: Leading zero in format ignored?
Date 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...!)



Replies:
Posted By: Oleg
Date Posted: 20 September 2006 at 1:47pm
Try set
i.UseSystemDecimalSymbol = False


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Miles
Date 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!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net