Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Info Window Builder in Arc2Earth to generate some kml for a large dataset.

I'm having some trouble formatting numeric values (pulled from the attribute table) to include commas (group separators). Basically I'm trying to output the numeric values as US dollar amounts (1234 -> $1,234.00).

I've found some success using the floatformat filter as follows:
[!MyFieldName|floatformat:2]
to successfully place exactly 2 digits to the right of the decimal point.

It seems I actually want to use the stringformat filter, but I can't figure out the correct syntax. I've tried permutations similar to the following:
[!MyFieldName|stringformat:("N", en-US)]
but with no luck.

Anyone know how to do this?

share|improve this question
up vote 1 down vote accepted

You should try [!MyFieldName|floatformat:C].

When applying the filter to stringformat/floatformat, the value after the colon is generally taken from these standard one: http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx or you can specify custom ones like these: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

Let me know if you need anything else for the info window builder and remember you can quickly preview the result instead of running the export.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.