Hello, I am reading some attributes from a database. Some are in string format, some in number (int, float etc.). I want to write these attributes to a json file.I noticed that all the attributes in string format are automatically output in quotation marks and the numbers without. In my case I have three attributes: district, lat and long. District is an int, lat and long are strings. How can I change lat and long so that their output is also without quotation marks like the district one (see image) ?
Solved
How can I convert an attribute from string to number? I want to write to a JSON file and have them in a number format.
Best answer by ebygomm
katt wrote:
I am using a JSON Templater. Maybe there is workaround to display the lat and long values without quotation marks?!
You can do something like this
{
"district" : xs:int(fme:get-attribute("district")),
"lat": xs:float(fme:get-attribute("lat")),
"lon": xs:float(fme:get-attribute("lon"))
}
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.