Skip to content

Commit 3d5f905

Browse files
authored
Merge pull request #1 from ecfan/patch-2
Editorial changes
2 parents 4ffb024 + 41eb4d9 commit 3d5f905

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

articles/logic-apps/workflow-definition-language-functions-reference.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,12 +1690,10 @@ And returns this result: `74`
16901690

16911691
### decimal
16921692

1693-
If you are working with data that requires decimal precision, you will find the [decimal](../logic-apps/workflow-definition-language-functions-reference.md#decimal) function useful. This function can be used on numbers that require decimal precision and then can be used as an input to [logical comparison](../logic-apps/workflow-definition-language-functions-reference.md#logical-comparison-functions) and [math](../logic-apps/workflow-definition-language-functions-reference.md#math-functions) functions.
1694-
1695-
To use the result of the decimal function and not lose precision, you should wrap any decimal output with the [string function](../logic-apps/workflow-definition-language-functions-reference.md#string) to ensure that the precision is captured. This is illustrated by the examples below where precision is lost if the decimal result is used as a number.
1693+
Returns a decimal number in a string as a decimal number. You can use this function when you're working with data that requires decimal precision and also as input for [logical comparison functions](#logical-comparison-functions) and [math functions](#math-functions). To capture and preserve precision when you use the result from the **decimal()** function, wrap any decimal output with the [string function](#string). This usage is shown in the following examples below where you can lose precision if you use the decimal result as a number.
16961694

16971695
> [!NOTE]
1698-
> The decimal precision that is talked about in the context of this function and the Logic App Runtime is the same as the [.NET decimal precision](https://docs.microsoft.com/dotnet/api/system.decimal?view=netframework-4.7.1&preserve-view=true).
1696+
> The decimal precision that's discussed in the context for this function and the Azure Logic Apps runtime is the same as the [.NET decimal precision](/dotnet/api/system.decimal?view=netframework-4.7.1&preserve-view=true).
16991697
17001698
```
17011699
decimal('<value>')
@@ -1713,44 +1711,36 @@ decimal('<value>')
17131711

17141712
*Example 1*
17151713

1716-
This example creates a decimal and uses it as a number:
1714+
This example creates a decimal that's used as a number:
17171715

17181716
```
1719-
decimal('1.2345678912312131')
1717+
decimal('1.2345678912312131') // Returns 1.234567891231213.
17201718
```
17211719

1722-
And returns this result: `1.23456789123121`
1723-
17241720
*Example 2*
17251721

1726-
This example creates a decimal and then converts it to a string to ensure the precision is kept:
1722+
This example creates a decimal and then converts the result to a string for precision preservation:
17271723

17281724
```
1729-
decimal('1.2345678912312131')
1725+
string(decimal('1.2345678912312131')) // Returns "1.2345678912312131".
17301726
```
17311727

1732-
And returns this result: `"1.2345678912312131"`
1733-
17341728
*Example 3*
17351729

17361730
This example uses a math function on two decimal numbers and uses the result as a number:
17371731

17381732
```
1739-
add(decimal('1.2345678912312131'), decimal('1.2345678912312131'))
1733+
add(decimal('1.2345678912312131'), decimal('1.2345678912312131')) // Returns 2.469135782462426.
17401734
```
17411735

1742-
And returns this result: `2.469135782462426`
1743-
17441736
*Example 4*
17451737

1746-
This example uses a math function on two decimal numbers and then converts it to a string to ensure the precision is kept:
1738+
This example uses a math function on two decimal numbers and converts the result to a string for precision preservation:
17471739

17481740
```
1749-
string(add(decimal('1.2345678912312131'), decimal('1.2345678912312131')))
1741+
string(add(decimal('1.2345678912312131'), decimal('1.2345678912312131'))) // Returns "2.4691357824624262".
17501742
```
17511743

1752-
And returns this result: `"2.4691357824624262"`
1753-
17541744
<a name="decodeBase64"></a>
17551745

17561746
### decodeBase64 (deprecated)

0 commit comments

Comments
 (0)