Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
    
did you try [!MyFieldName|stringformat:("C", en-US)] ? –  Kirk Kuykendall Apr 12 '11 at 21:59
    
i did. didn't work. in both cases it spits out the number without any formatting at all, as if arc2earth is failing gracefully on my poorly formed tag. –  sfletche Apr 12 '11 at 22:10

1 Answer 1

up vote 1 down vote accepted

did you 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

cheers brian

share|improve this answer
    
Success! Thanks bFlood! –  sfletche Apr 13 '11 at 16:34

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.