Skip to content

Commit 4717c49

Browse files
Update truncate.md
1 parent aa99b28 commit 4717c49

File tree

1 file changed

+2
-2
lines changed
  • content/c-sharp/concepts/math-functions/terms/truncate

1 file changed

+2
-2
lines changed

content/c-sharp/concepts/math-functions/terms/truncate/truncate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Math.Truncate(decimal d)
3939

4040
> **Note:** `Math.Truncate()` always rounds towards zero. This means `Math.Truncate(2.8)` is 2, and `Math.Truncate(-2.8)` is -2. This is different from `Math.Floor()`, which always rounds down (e.g., `Math.Floor(-2.8)` would be -3).
4141
42-
## Example 1: Using double
42+
## Example 1: Using `double`
4343

4444
In this example, a double value is truncated to its integer part:
4545

@@ -64,7 +64,7 @@ Truncating 12.9 gives: 12
6464
Truncating -4.7 gives: -4
6565
```
6666

67-
## Example 2: Using decimal
67+
## Example 2: Using `decimal`
6868

6969
In this example, a `decimal` value is truncated without using the `m` suffix by explicitly casting a `double` to `decimal`:
7070

0 commit comments

Comments
 (0)