Category Archives: CurrencyFormatter

Creating a custom label function on a Flex LineChart control’s linear axis

The following example shows how you can create a custom label function on a LinearAxis in a Flex LineChart control.

For an example of creating a custom label function for the horizontal/category axis, check out “Creating a custom label function on a Flex LineChart control’s category axis”.

Full code after the jump.

Continue reading Creating a custom label function on a Flex LineChart control’s linear axis

Building a simple tip calculator in Flex

The following example shows a very simple (and probably somewhat buggy) tip calculator which I put together in a few minutes using Flex. Nothing really new, but sometimes its fun to combine a few of the things we’ve covered over the past posts and build something a bit more interesting.

Full code after the jump.

Continue reading Building a simple tip calculator in Flex

Using the CurrencyValidator and CurrencyFormatter classes to validate and format numbers

The following entry shows how users can store an unformatted number and display it back to users when the TextInput control is being edited. When the text input control loses focus, the data is validated and formatted (if the data was valid) or focus is returned to the control if validation failed.

Full code after the jump.

Continue reading Using the CurrencyValidator and CurrencyFormatter classes to validate and format numbers

Formatting a Flex DataGrid control using a custom item renderer

The following example formats a column in a Flex DataGrid and uses a custom item renderer to color the text red in a cell if a price is below $0. If the item is greater than $0, the test is displayed in black. The price column is also formatted using a custom label function, which uses a CurrencyFormatter, and finally, the data grid column uses a custom sort function to properly sort numeric columns.

Full code after the jump.

Continue reading Formatting a Flex DataGrid control using a custom item renderer