Skip to content

Commit

Permalink
added abs to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
royNiladri committed Jan 3, 2023
1 parent 7739db6 commit 1f3ff60
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"eslint.enable": false
"eslint.enable": false,
"spellright.language": [
"en"
],
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext"
]
}
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Contents

- [Contributors Welcome!](#contributors-welcome)
- [Installation](#installation)
- [Usage](#usage)
- [Operations](#operations)
- [bigDecimal(number)](#bigdecimalnumber)
- [getValue()](#getvalue)
- [getPrettyValue(number, digits, separator)](#getprettyvaluenumber-digits-separator)
- [round(number, precision, roundingMode)](#roundnumber-precision-roundingmode)
- [abs(number)](#absnumber)
- [floor(number)](#floornumber)
- [ceil(number)](#ceilnumber)
- [compareTo(number1, number2)](#comparetonumber1-number2)
Expand Down Expand Up @@ -143,6 +145,18 @@ var numRound1 = num.round(1, bigDecimal.RoundingModes.DOWN); // "123.6"
var numRound2 = num.round(2, bigDecimal.RoundingModes.CEILING); // "123.66"
```

### abs(number)
Returns the absolute value of a number.
```javascript
var n1 = bigDecimal.abs(12.8) // "12.8"
var n2 = bigDecimal.abs(-12.3) // "12.3"
```
The instance returns the result as new `bigDecimal`
```javascript
var n1 = new bigDecimal(12.8).abs() // bigDecimal(12.8)
var n2 = new bigDecimal(-12.3).abs() // bigDecimal(-12.3)
```

### floor(number)
Returns the whole number nearest but not greater than the input number.
```javascript
Expand Down

0 comments on commit 1f3ff60

Please sign in to comment.