# Label numeric format error in development builds?

**URL:** <https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959>\
**Category:** WinForms\
**Created:** [April 21, 2012, 8:23am UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959 "2012-04-21T08:23:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [April 21, 2012, 8:23am UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/1 "2012-04-21T08:23:20Z")

</div>

I&nbsp;apply&nbsp;a&nbsp;text&nbsp;style&nbsp;for&nbsp;numeric&nbsp;data&nbsp;that&nbsp;has&nbsp;the&nbsp;.NumericFormat&nbsp;property&nbsp;set&nbsp;to&nbsp;"{0:F0}".&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In&nbsp;5.5.33,&nbsp;I&nbsp;get&nbsp;a&nbsp;map&nbsp;that&nbsp;displays&nbsp;values&nbsp;as&nbsp;expected...&nbsp;&nbsp;&nbsp;values&nbsp;of&nbsp;2,&nbsp;4,&nbsp;5,&nbsp;etc&nbsp;are&nbsp;displayed&nbsp;as&nbsp;"2",&nbsp;"4",&nbsp;and&nbsp;"5".&nbsp;&nbsp;&nbsp;But&nbsp;in&nbsp;5.5.160,&nbsp;these&nbsp;same&nbsp;values&nbsp;are&nbsp;displayed&nbsp;as&nbsp;"{0:F2}",&nbsp;"{0:F4}",&nbsp;and&nbsp;"{0:F5}".&nbsp;&nbsp;&nbsp;&nbsp;Has&nbsp;something&nbsp;changed&nbsp;with&nbsp;the&nbsp;way&nbsp;the&nbsp;.NumericFormat&nbsp;property&nbsp;works?&nbsp;&nbsp;&nbsp;Or&nbsp;is&nbsp;this&nbsp;a&nbsp;bug?

Here&nbsp;is&nbsp;the&nbsp;5.5.33&nbsp;output

 ![](https://community.thinkgeo.com/uploads/default/original/1X/2abdbcb1ce95684610774e3322b5443064de575d.png)

Here&nbsp;is&nbsp;the&nbsp;5.5.160&nbsp;output.&nbsp;&nbsp;Note&nbsp;that&nbsp;the&nbsp;number&nbsp;behind&nbsp;the&nbsp;F&nbsp;is&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;feature.

 ![](https://community.thinkgeo.com/uploads/default/original/1X/69c35dbeb2ae3390b4405ff8f55e92c5f9adafab.png)

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [April 23, 2012, 4:14pm UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/2 "2012-04-23T16:14:03Z")

</div>

Hello&nbsp;Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;could&nbsp;you&nbsp;please&nbsp;post&nbsp;some&nbsp;code&nbsp;I&nbsp;can&nbsp;have&nbsp;a&nbsp;check?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [April 23, 2012, 4:19pm UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/3 "2012-04-23T16:19:45Z")

</div>

No.&nbsp;That&nbsp;will&nbsp;not&nbsp;be&nbsp;easy.&nbsp;But&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;numeric&nbsp;layer,&nbsp;create&nbsp;a&nbsp;text&nbsp;style&nbsp;label&nbsp;for&nbsp;it&nbsp;to&nbsp;display&nbsp;a&nbsp;feature&nbsp;value&nbsp;such&nbsp;as&nbsp;Population,&nbsp;area,&nbsp;objectID,&nbsp;whatever.&nbsp;Set&nbsp;the&nbsp;TextStyle.NumericFormat&nbsp;=&nbsp;"{0:F0}".&nbsp;You&nbsp;will&nbsp;see&nbsp;the&nbsp;label&nbsp;printed&nbsp;as&nbsp;this&nbsp;format,&nbsp;with&nbsp;the&nbsp;last&nbsp;zero&nbsp;replaced&nbsp;by&nbsp;the&nbsp;text&nbsp;value,&nbsp;as&nbsp;shown&nbsp;in&nbsp;the&nbsp;second&nbsp;illustration.&nbsp;  
  
  
  
Today,&nbsp;I&nbsp;have&nbsp;learned&nbsp;that&nbsp;if&nbsp;you&nbsp;set&nbsp;the&nbsp;TextStyle.NumericFormat&nbsp;=&nbsp;"{0:F2}",&nbsp;you&nbsp;will&nbsp;see&nbsp;the&nbsp;leading&nbsp;zero&nbsp;replaced,&nbsp;creating&nbsp;a&nbsp;label&nbsp;of&nbsp;"{4:F2}"&nbsp;for&nbsp;the&nbsp;upper&nbsp;left&nbsp;label.&nbsp;  
  
  
  
This&nbsp;is&nbsp;leading&nbsp;me&nbsp;to&nbsp;believe&nbsp;you&nbsp;have&nbsp;done&nbsp;something&nbsp;with&nbsp;the&nbsp;NumericFormat&nbsp;to&nbsp;allow&nbsp;multiple&nbsp;feature&nbsp;values&nbsp;to&nbsp;be&nbsp;embedded&nbsp;within&nbsp;a&nbsp;single&nbsp;text&nbsp;string,&nbsp;or&nbsp;something.&nbsp;Has&nbsp;the&nbsp;use&nbsp;of&nbsp;NumericFormat&nbsp;changed&nbsp;since&nbsp;the&nbsp;initial&nbsp;5.5.0&nbsp;release?&nbsp;  
  
&nbsp;

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [April 24, 2012, 7:38am UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/4 "2012-04-24T07:38:00Z")

</div>

This&nbsp;is&nbsp;the&nbsp;help&nbsp;for&nbsp;NumericFormat&nbsp;on&nbsp;the&nbsp;Wiki.&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;&nbsp;"{0:F2}"&nbsp;is&nbsp;not&nbsp;valid,&nbsp;can&nbsp;you&nbsp;tell&nbsp;me&nbsp;what&nbsp;the&nbsp;syntax&nbsp;of&nbsp;this&nbsp;has&nbsp;changed&nbsp;to?&nbsp;  
&nbsp;&nbsp;  
&nbsp;NumericFormat&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;This&nbsp;property&nbsp;gets&nbsp;and&nbsp;sets&nbsp;the&nbsp;format&nbsp;that&nbsp;will&nbsp;be&nbsp;applied&nbsp;to&nbsp;the&nbsp;text&nbsp;which&nbsp;can&nbsp;be&nbsp;parsed&nbsp;to&nbsp;double&nbsp;type.&nbsp;  
&nbsp;&nbsp;&nbsp;  
&nbsp;Remarks&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;With&nbsp;this&nbsp;property,&nbsp;you&nbsp;can&nbsp;apply&nbsp;formats&nbsp;to&nbsp;the&nbsp;text&nbsp;that&nbsp;is&nbsp;retrieved&nbsp;from&nbsp;the&nbsp;feature.&nbsp;

---

<div class="post-metadata">

**Author:** ![Ryan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@Ryan](https://community.thinkgeo.com/u/Ryan)\
**Post date:** [April 24, 2012, 5:54pm UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/5 "2012-04-24T17:54:38Z")

</div>

Hi&nbsp;Ted,

I&nbsp;think&nbsp;this&nbsp;might&nbsp;be&nbsp;a&nbsp;result&nbsp;of&nbsp;some&nbsp;changes&nbsp;made&nbsp;in&nbsp;5.5.75.0&nbsp;to&nbsp;resolve&nbsp;an&nbsp;issue&nbsp;with&nbsp;IsoLine&nbsp;labeling&nbsp;in&nbsp;this&nbsp;post:&nbsp;[gis.thinkgeo.com/Support/Dis...fault.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/9970/afv/topic/Default.aspx)

I&nbsp;found&nbsp;in&nbsp;my&nbsp;sample&nbsp;that&nbsp;if&nbsp;I&nbsp;utilzed&nbsp;a&nbsp;Custom&nbsp;Numeric&nbsp;Format&nbsp;found&nbsp;on&nbsp;the&nbsp;following&nbsp;MSDN&nbsp;link&nbsp;that&nbsp;the&nbsp;formatting&nbsp;behaved&nbsp;properly:&nbsp;  
  
[msdn.microsoft.com/en-us/library/0c899ak8.aspx](http://msdn.microsoft.com/en-us/library/0c899ak8.aspx)

&nbsp;

Here&nbsp;is&nbsp;some&nbsp;sample&nbsp;code&nbsp;used&nbsp;I&nbsp;used&nbsp;to&nbsp;test:

`worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));            TextStyle countryTextStyle = new TextStyle("POP_CNTRY", new GeoFont("Arial",10), new GeoSolidBrush(GeoColor.StandardColors.Black));                        //Standard Numeric Format Strings            //countryTextStyle.NumericFormat = "{0:F0}";            //countryTextStyle.NumericFormat = "{0:D6}";            //Custom Numeric Format Strings            //countryTextStyle.NumericFormat = "000.000";            //countryTextStyle.NumericFormat = "###";                        worldLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = countryTextStyle;            worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;`

Here&nbsp;is&nbsp;the&nbsp;result&nbsp;of&nbsp;using&nbsp;a&nbsp;Custom&nbsp;Format:

 ![](https://community.thinkgeo.com/uploads/default/original/2X/6/686b95d2a3b94f19d461b7b259a16e7943a5f572.png)  
  
This&nbsp;would&nbsp;seem&nbsp;to&nbsp;be&nbsp;a&nbsp;bug&nbsp;as&nbsp;I&nbsp;would&nbsp;not&nbsp;expect&nbsp;the&nbsp;Standard&nbsp;Numeric&nbsp;Formatting&nbsp;support&nbsp;to&nbsp;be&nbsp;removed.  
  
This&nbsp;will&nbsp;be&nbsp;created&nbsp;as&nbsp;an&nbsp;Internal&nbsp;Ticket&nbsp;for&nbsp;futher&nbsp;review&nbsp;but&nbsp;for&nbsp;now&nbsp;you&nbsp;might&nbsp;setup&nbsp;a&nbsp;Custom&nbsp;Numeric&nbsp;Format&nbsp;that&nbsp;matches&nbsp;your&nbsp;needs.

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [April 24, 2012, 6:06pm UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/6 "2012-04-24T18:06:54Z")

</div>

Thanks.&nbsp;&nbsp;I’ll&nbsp;give&nbsp;it&nbsp;a&nbsp;whirl.

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [April 25, 2012, 10:20am UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/7 "2012-04-25T10:20:59Z")

</div>

Hello&nbsp;Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;are&nbsp;welcome,&nbsp;please&nbsp;let&nbsp;us&nbsp;know&nbsp;if&nbsp;you&nbsp;still&nbsp;meet&nbsp;the&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [April 25, 2012, 10:25am UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/8 "2012-04-25T10:25:18Z")

</div>

I&nbsp;have&nbsp;confirmed&nbsp;that&nbsp;I&nbsp;can&nbsp;use&nbsp;"F2"&nbsp;instead&nbsp;of&nbsp;"{0:F2}"&nbsp;and&nbsp;it&nbsp;works.&nbsp;I've&nbsp;modified&nbsp;my&nbsp;code.&nbsp;But&nbsp;I&nbsp;agree&nbsp;with&nbsp;Ryan...&nbsp;something&nbsp;changed&nbsp;on&nbsp;this&nbsp;that&nbsp;broke&nbsp;the&nbsp;original&nbsp;behavior.

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [April 25, 2012, 3:34pm UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/9 "2012-04-25T15:34:05Z")

</div>

Hello&nbsp;Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I’m&nbsp;glad&nbsp;it’s&nbsp;working,&nbsp;we&nbsp;will&nbsp;research&nbsp;this&nbsp;and&nbsp;see&nbsp;if&nbsp;we&nbsp;can&nbsp;change&nbsp;it&nbsp;back.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Please&nbsp;don’t&nbsp;hesitate&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;your&nbsp;problems.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Ben](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ben/32/25720_2.png) [@Ben](https://community.thinkgeo.com/u/Ben)\
**Post date:** [May 14, 2012, 8:31pm UTC](https://community.thinkgeo.com/t/label-numeric-format-error-in-development-builds/1959/10 "2012-05-14T20:31:54Z")

</div>

Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;should&nbsp;have&nbsp;make&nbsp;it&nbsp;the&nbsp;current&nbsp;way&nbsp;at&nbsp;the&nbsp;beginning&nbsp;as&nbsp;that&nbsp;is&nbsp;the&nbsp;real&nbsp;format&nbsp;strings&nbsp;while&nbsp;"{0}"&nbsp;is&nbsp;just&nbsp;the&nbsp;parameter&nbsp;index.&nbsp;I&nbsp;am&nbsp;very&nbsp;sorry&nbsp;for&nbsp;the&nbsp;inconvenience&nbsp;that&nbsp;it&nbsp;broke&nbsp;the&nbsp;original&nbsp;behavior.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Ben
