1 Reply Latest reply on May 20, 2012 8:51 AM by davidanders

    Converting a european format number to a US number

    DickVerschuur

      Title

      Converting a european format number to a US number

      Post

      Hello everybody

      I need some help with a calculation field.

      I have a number field that holds a calculated value.
      The decimal separator is European: a comma.
      Because it is a calculated value the number of decimals are not always 2:
      It could be 1000,5 or 1000,52 or even 1000,5232198

      My problem:
      i need to export the field to a MySQL table
      the format should then be: 1000.00 (US currency, with two decimals)

      Can anyone help me with a calculation that:
      - sets the number of decimals to 2
      - converts the comma to a point


      Great!

      Dick

        • 1. Re: Converting a european format number to a US number
          davidanders

          On one layout you can have multiple instances of the same number field. Eech instance can be formatted to display the number differently.

          Google "number field formatting filemaker"
          http://www.google.com/search?q=number+field+formatting+filemaker

          http://dwaynewright.squarespace.com/filemaker-layouts/2008/4/20/filemaker-layout-number-field-formatting-options.html

           

          Home > Designing and creating databases > Editing objects on layouts > Formatting and setting up field objects in Layout mode > Specifying formats for fields containing numbers

          Specifying formats for fields containing numbers

          You can control how FileMaker Pro displays the values in number fields, calculation fields with numeric results, and summary fields.
          To specify formats for fields containing numbers:
          1.
          In Layout mode, select one or more fields that display numeric values.
          For more information, see Selecting objects.
          2.
          Click Inspector Inspector button in the layout bar, then click Data.
          3.
          In the Data Formatting area, click NumberNumber button, then select the formats you want to use from the Format list.

           
           
          To display numbers
          Do this
          Rounded as needed or expressed in scientific notation, so the number fits within the default field boundaries
          Select General.
          Exactly as entered (if the value has more digits than will display in the field, a ? appears in the field)
          Select As entered.
          As a Boolean value (a value that is generally expressed as one of two values — zero or non-zero)
          Select Boolean.
          To change the default values, type a new value (up to seven characters) for Show non-zeros as and Show zeros as (such as “Yes” and “No”).
          As a decimal number
          Select Decimal.
           •
          To specify that each value be displayed with the same number of places, select Fixed number of decimals and type a value. (A positive value specifies places to the right of the decimal place, a negative value specifies places to the left.)
           •
          To specify a unit for a number, type a Symbol to display for the unit and choose one of the options in the Notation list to specify where to insert the symbol. Some examples of symbols are cm (centimeter), km (kilometer), kg (kilogram), or ft (foot).
           •
          To specify special formatting for negative numbers, in the Negative area, choose a notation. To display a negative numbers in color (for example, red), choose a color.
           •
          To change the character that separates the whole value of the number from the fractional part, for Separators, type a character.
           •
          To include a character to separate every 3 digits, click Use thousands separator and type a character.
           •
          To include a Kanji separator, click Kanji separator and choose either the every 4th place or full notation options.
          As a percentage (FileMaker Pro multiplies the value by 100 and displays %)
          Select Percent.
          Except for Notation, all the other options listed for displaying numbers as a decimal number are also available when you select Percent.
          As currency
          Select Currency. You can choose whether the currency symbol:
           •
          leads before or trails after the value
           •
          appears inside or outside of the negative sign
          To change the currency symbol, for Symbol, type a character.
          Except for Notation, all the other options listed for displaying numbers as a decimal number are also available when you select Currency.
          As nothing if the number is zero
          Select Format as decimal. Then select Do not display number if zero.
          Using a different Japanese numeral type (if you’re using a font that contains Japanese characters)
          Select Decimal, Currency, or Percent. Then, for Numeral type, choose Half-Width, Full-Width, Kanji Numeral (Modern), or Kanji Numeral.
          With different text formatting
          Select text options using the Appearance tab of the Inspector. For more information, see Specifying text formats for fields.
          4.
          Press Enter or Tab, or click outside the Inspector to apply the changes.
          Notes
           •
          If you specify General format and the field value is a number with 10 or more digits, FileMaker Pro displays the number using scientific notation, or rounds the number, or both, if necessary, to fit within the 10-character maximum for the default field boundaries. When a number is expressed in scientific notation, you see a decimal number expressed as a power of 10, for example, 123,456,789,000 could be displayed as 1.2346E+11. If the field value is a number of fewer than 10 digits, specifying General format produces the same result as specifying As entered.
           •
          If FileMaker Pro displays a number in a field as a ?, try enlarging the field boundaries in Layout mode to see the entire value. (When you print a layout with a field that is displaying a ?, FileMaker Pro prints as many digits as will fit within the field boundaries and truncates the other digits.)
           •
          Numbers formatted as decimals are rounded when the number of decimal digits exceeds the specified fixed number of decimal digits. (For example, if you enter 789.78 and you specify 3 fixed digits, you see 789.780 in the field; if you specify 0 fixed digits, you see 790; if you specify -2 fixed digits, you see 800.) However, FileMaker Pro stores and uses the unrounded number for calculations and summaries.
           •
          Only numbers are displayed and printed in a number field formatted as decimal (except for separators and notations specified in the Inspector). To display text and symbols (for example, @1.98 per pound) in a number field, select As entered. If you use the field in a calculation or summary, only the numeric value is used.
           •
          If you specify the format as Boolean, any values in the number field that contain non-numeric data display as blank because they do not contain any numeric content. For example, the value “ABC” would display as blank. However, non-numeric field content returns false in calculations.
           •
          For more information about defining number fields, see Defining number fields.