000-349 · Question #49
An application developer is creating a map to produce a report which will include literal text concatenated with a numeric item named TotalCount. Which map rule should the developer use to produce…
The correct answer is B. ="The totals are " + FROMNUMBER (TotalCount, "{#','###}") + "!". The FROMNUMBER function converts a numeric value to formatted text using a pattern string, which is required to produce a thousands-separated output like 2,541.
Question
An application developer is creating a map to produce a report which will include literal text concatenated with a numeric item named TotalCount. Which map rule should the developer use to produce the following line of their report if TotalCount = 2541: The totals are 2,541!
Options
- A="The totals are " + NUMBERTOTEXT (TotalCount) + "!"
- B="The totals are " + FROMNUMBER (TotalCount, "{#','###}") + "!"
- C="The totals are " + CONVERTTOTEXT (TotalCount, "{#','###}") + "!"
- D="The totals are " + NUMBERTOTEXT (TotalCount, "{#','###}") + "!"
How the community answered
(34 responses)- A18% (6)
- B71% (24)
- C3% (1)
- D9% (3)
Why each option
The FROMNUMBER function converts a numeric value to formatted text using a pattern string, which is required to produce a thousands-separated output like 2,541.
NUMBERTOTEXT converts a number to text but does not accept a format pattern argument, so it cannot insert a thousands separator to produce '2,541'.
FROMNUMBER accepts a numeric argument and a format pattern string; the pattern specifying a comma as the thousands separator correctly produces '2,541' when TotalCount equals 2541, and this result is then concatenated with the surrounding literal strings to yield the exact expected output.
CONVERTTOTEXT is not a valid map function for numeric-to-text conversion with a format pattern in this mapping tool.
NUMBERTOTEXT does not support a second format argument, making this syntax invalid even though the format pattern itself is correct.
Concept tested: FROMNUMBER function with numeric format pattern
Source: https://www.ibm.com/docs/en/b2b-integrator/6.1?topic=functions-fromnumber
Topics
Community Discussion
No community discussion yet for this question.