Skip to content

Commit

Permalink
Add number trim method
Browse files Browse the repository at this point in the history
  • Loading branch information
curder committed Aug 1, 2024
1 parent 4311655 commit 1a967b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/others/helpers/numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ Number::spell(808, locale: 'zh_CN'); // 八百〇八
Number::spell(808, locale: 'zh_TW');// 八百零八
```

## `trim()` 去除小数点后多余的0

```php
Number::trim(12); // 12
Number::trim(120); // 120
Number::trim(12.0); // 12
Number::trim(12.3); // 12.3
Number::trim(12.30); // 12.3
Number::trim(12.3456789); // 12.3456789
Number::trim(12.34567890000); // 12.3456789
```


## 其它方法

Expand Down

0 comments on commit 1a967b4

Please sign in to comment.