Using formatted input numbers |
In some countries, commas are used as decimal separators and dots as thousand separators. But, if you directly specify such numbers in FusionMaps XML, it will give an error while converting to number. FusionMaps implements a smart way to let you specify numbers in your own format in XML. Consider the XML below: |
<map inThousandSeparator='.' inDecimalSeparator=',' formatNumberScale='0'>
<data> <entity id='NA' value='420.315,43' /> <entity id='SA' value='295.345,98' /> <entity id='AS' value='523.323,76' /> <entity id='EU' value='334.345,34' /> <entity id='AF' value='133.434,35' /> <entity id='AU' value='475.032,32' /> </data> </map> |
In this XML, we're providing the numbers in the non-standard convention - i.e., we've used dot as the thousand separator and comma as the decimal separator (as followed in some European countries). Now, to make sure that FusionMaps reads these numbers in the right way, we convey our input decimal and thousand separator characters as under: <map ... inThousandSeparator='.' inDecimalSeparator=',' ..> This tells FusionMaps that it should treat dot in the input numbers as thousands (instead of normal decimals) and comma as decimals. When you now view this map, you'll get the following output: |
You can see that FusionMaps has interpreted the numbers properly and automatically converted the numbers into the standard format. If you want to output the number again in the non-conventional format, you can use the following XML: |
<map inThousandSeparator='.' inDecimalSeparator=',' formatNumberScale='0' thousandSeparator='.' decimalSeparator=',' >
|
In the above XML we're specifying custom characters for both input and output formats. When you now see the map, you'll get something as under: |