---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Orchestration Builder, Orchestrate, Orchestration]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: BigDecimal Member Functions
layout: subsection
---

<b>Instance Type: BigDecimal</b>

<table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>divide</td><td>Arguments: <ul><li>divisor (BigDecimal)
</li><li>scale (Number)
</li><li>roundingMode (String)
</li></ul> Return Type: <ul><li>BigDecimal
</li></ul> <p>Returns the value of the BigDecimal divided by the specified divisor, using the specified rounding mode when it's required to generate a result at the given scale. A scale of 3 means 3 digits after the decimal point. The number 1.2345 at scale 2 is 1.23. The value 0.0045 is said to be discarded.</p> <p>There are 7 types of rounding modes, 4 directional, 2 nearest neighbor, and 1 other.</p> <p>The directional rounding modes:</p><ul><li><code>UP</code>: Rounds away from zero if there are discarded digits.

<p>Examples:</p><ul><li>5.811 at scale 1rounds to 5.9.
</li><li>-10.0001 at scale 3 rounds to -10.001.
</li></ul></li><li><code>DOWN</code>: Rounds towards zero by truncating the discarded digits.

<p>Examples:</p><ul><li>12.99 at scale 1rounds to 12.9.
</li><li>-0.54321 at scale 3 rounds to -0.543.
</li></ul></li><li><code>CEILING</code>: Rounds towards positive infinity.

<p>If the number is positive, behaves like <code>UP</code>. Example:</p><ul><li>8.7651 at scale 3 rounds to 8.766.
</li></ul><p>If the number is negative, behaves like <code>DOWN</code>. Example:</p><ul><li>-3.48 at scale 1 rounds to -3.4.
</li></ul></li><li><p><code>FLOOR</code>: Rounds towards negative infinity.</p><p>If the number is positive, behaves like <code>DOWN</code>. Example:</p><ul><li>45.19 at scale 1rounds to 45.1.
</li></ul><p>If the number is negative, behaves like <code>UP</code>. Example:</p><ul><li>-9.876 at scale 2rounds to -9.88.
</li></ul></li></ul><p>The nearest neighbor rounding modes:</p><ul><li><code>HALF_UP</code>: Rounds towards the nearest neighbor. Rounds up if the discarded digits are greater than or equal to 5.

<p>Examples:</p><ul><li>9.153 at scale 2 rounds to 9.15.
</li><li>99.5 at scale 0 rounds to 100.
</li></ul></li><li><code>HALF_DOWN</code>: Rounds towards the nearest neighbor. Rounds up if the discarded digits are greater than 5. Rounds down if the discarded digits are equal to 5.

<p>Examples:</p><ul><li>16.0851 at scale 3 is 16.086.
</li><li>17.05 at scale 1 rounds to 17.
</li></ul></li><li><code>HALF_EVEN</code>: Rounds to the nearest neighbor. Rounds to the last retained even digit if the discarded digits are equal to 0.5.

<p>Examples:</p><ul><li>7.135 at scale 2 rounds to 7.14.
</li><li>17.5 at scale 0 rounds to 18.
</li></ul></li></ul><p>The other rounding mode:</p><ul><li><p><code>UNNECESSARY</code>: Requires an exact result that doesn't need rounding. Throws an exception if the result isn't exact.</p></li></ul></td></tr><tr><td>negate</td><td>Arguments: <ul><li>None
</li></ul> Return Type: <ul><li>BigDecimal
</li></ul> Returns the negation of the BigDecimal value.</td></tr><tr><td>power</td><td>Arguments: <ul><li>n (Number)
</li></ul> Return Type: <ul><li>BigDecimal
</li></ul> Returns the value of the BigDecimal raised to the power of the specified number.</td></tr><tr><td>precision</td><td>Arguments: <ul><li>None
</li></ul> Return Type: <ul><li>Number
</li></ul> Returns the number of digits in the unscaled BigDecimal value. <p>The precision of a zero value is 1.</p></td></tr><tr><td>remainder</td><td>Arguments: <ul><li>divisor (BigDecimal)
</li></ul> Return Type: <ul><li>BigDecimal
</li></ul> Returns the value of the remainder when the BigDecimal is divided by the specified divisor.</td></tr><tr><td>scale</td><td>Arguments: <ul><li>None
</li></ul> Return Type: <ul><li>Number
</li></ul> Returns the scale of the BigDecimal. If the BigDecimal is zero or positive, the scale is the number of digits to the right of the decimal point. If it's negative, the unscaled value of the number is multiplied by 10 to the power of the negation of the scale.</td></tr><tr><td>toString</td><td>Arguments: <ul><li>None
</li></ul> Return Type: <ul><li>String
</li></ul> Returns a string representation of the value.</td></tr></tbody></table><br/>

