Please enable JavaScript to view this site.

Altova MapForce 2021 Professional Edition

Converts a string into a decimal number, according to specified format.

mf-func-parse-number

 

Languages

Built-in, C++, C#, Java.

 

Parameters

Argument

Description

value

The string to be converted to a number.

format

Optional argument. A format string that identifies the way in which the number is currently formatted. The format string is the same as that used in format-number.

 

Default is "#,##0.#"

decimal-point-character

Optional argument. Specifies the character to be used as the decimal point character. Default is the '.' character.

grouping-separator

Optional argument. Specifies the separator/delimiter used to separate groups of numbers. Default is the "," character.

 

Example

The following mapping parses the string value "1,234.50" to a decimal equivalent, by using the format mask #,##0.00. In this mapping , there is no need to connect the decimal-point-character and grouping-separator arguments, since their default values match the format of the input string.

mf-func-parse-number-example

The mapping result is as follows (excluding the XML and namespace declarations):

 

<Article>
  <Number>1</Number>
  <Name>Office chair</Name>
  <SinglePrice>1234.5</SinglePrice>
</Article>

© 2015-2021 Altova GmbH