Michael Cruden
 · Seamless Technology Integration

How do I format numbers that come back from an API call?

I have an API that returns prices for assets that I am displaying in a table. Have them on page... but numbers are not looking good. I need to format numbers in a few ways:

Currency - return 1111.22222 - display 1,111.22
Integer - return 1.3333 - display 1.3
Percent - return 6.5 - display 6.5%

The issue I am having is I cannot locate how to access the option in the docs I link to below. I don't see a number widget, so I am guessing you use the text field to output it. However, I cannot figure out how to assign these values as an integer in order to enable these formatting options. It appears to treat them only as text. How do I convert these fields so that I can better control the output?

https://docs.flutterflow.io/widgets-and-components/widgets/base-elements/text#format-a-number

2
4 replies