Documentation Archive Developer
Search
Table of Contents Previous Section

Setting a Number Format

In addition to a dateformat attribute, text field elements also have a numberformat attribute.

  1. Inspect the revenue text field.

    The revenue text field's numberformat attribute is bound to the string "###.##". This binding tells the text field that it's displaying a number and describes how to format it.

  2. Change the text field's numberformat binding value to the string (including the quotes): "$ #,##0.00".

    Using this number format, the Movies application formats the number 1750000 as $ 1,750,000. For more information on creating number formats, see the NumberFormatter class specification in the Foundation Framework Reference.

Table of Contents Next Section