I am trying to change the display of numeric data shown as labels using a TextStyle. In particular, I would like to add precision to a certain number of decimal places. It seems like I should be able to control this using the NumericFormat property on the TextStyle class. However, I can't seem to figure out the format for the NumericFormat string. I have tried using the formatting value used in C# for String.Format similar to "###.###" and "N3" but this merely display these values in place of the labels on the map.
Can anyone provide me with a brief tutorial on setting the NumericFormat, TextFormat, and DateFormat for TextStyles? If you can give me a suggestion on the way to build a format string I might be able to figure out the actual formating I desire.
Those Format properties basically follows the standards used by microsoft for formatting numbers, string and dates. You can find the guide in this link for example csharp-examples.net/string-format-double/.
Let's take the example, of an Integer based column and you want to format the values on the map with the comma separator, then according to the link above, you would use the code: textStyle.NumericFormat = "{0:0,0.0}";
So, without the NumericFormat property, the label looks like that:
Val, Thanks so much for the detailed answer. This is the information I was looking for to confirm that I had tried to do the formatting in the correct way. Unforunately, the problem does not appear to be the formatting on the TextStyle using NumericFormat or TextFormat. It appears to be some internal processing that occurs inside of the IsoLine classes which is truncating the values to integers. I have a trouble ticket open on this issue now and I will continue to monitor it via the ticket #6106.
Just to confirm. I did a search on the WorldMapKitData folder on the "server" and nothing has been updated within the folder for more than one month which would be longer than the time period we have observed this issue.
Just to wrap up on this topic, there are some fixes that were applied in Daily Development Build 5.5.75.0 to the IsoLineLayer and TextStyle classes which resolved this issue. With this build, I am able to define the NumericFormat as "#####.###" on the TextStyle definition in the Isolines code and the labels display as a numeric (floating pont/double) such as 100.962 as desired. See ticket 6106 for additional details.
Thanks to both Ryan and David for their help on this issue.