Skip to content

Commit 3390383

Browse files
Decimal cast update (laravel#8179)
The current docs have two things that need to be adjusted to give better clarity into the `decimal` cast. First, there is a space between "decimal:" and "<digits>" that is created because of putting two code blocks next to each other. It could easily be conceived that the cast should be written as `decimal: 2`, for example with a space between the colon and the precision value. This PR corrects that by wrapping the entire cast example in a single code block. Secondly, the "digits" parameter has been changed to be "precision" as that gives better understanding as to what that value is intended to do/be. While the `asDecimal` method in `HasAttributes` and the `number_format` function call this parameter "decimals", both "decimals" and "digits" are vague as to their intended purpose in the usage of this cast. Let me know if you need me to adjust or change anything or you have any questions. Thanks!
1 parent f22ecfb commit 3390383

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eloquent-mutators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ The `$casts` property should be an array where the key is the name of the attrib
220220
- `datetime`
221221
- `immutable_date`
222222
- `immutable_datetime`
223-
- `decimal:`<code>&lt;digits&gt;</code>
223+
- <code>decimal:&lt;precision&gt;</code>
224224
- `double`
225225
- `encrypted`
226226
- `encrypted:array`

0 commit comments

Comments
 (0)