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
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"))
}
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Login to the community
No account yet? Create an account
An FME Account is required to contribute
LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.


--
Make sure your selecting an attribute (ellipsis) not an Attribute Value. You'll have to add the UTC Offset manually