Is there a transformer that can convert a number into a number with a thousands separator, that is, "1000" to "1,000"? I know you can do it with Python but I can't find a transformer that does this.
Thanks
Is there a transformer that can convert a number into a number with a thousands separator, that is, "1000" to "1,000"? I know you can do it with Python but I can't find a transformer that does this.
Thanks
Best answer by david_r
I see you specifically asked for a non-Python solution, but since it involves several transformers, here's one anyway ;-)
import fmeobjects
def FeatureProcessor(feature):
value = feature.getAttribute('num') or ''
try:
value_str = "{:,}".format(value)
except ValueError, TypeError:
value_str = value
feature.setAttribute('num', value_str)
Assumes input features with an attribute called "num" (change lines 4 and 9 as necessary)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.