6 months ago

Prevent laravel from removing trailing zeros

Posted 6 months ago by n1smo


i have a small problem. I have a database field "order_id". The field can be a simple number "1234" but can also be like "1234.10". Now in the second case the trailing zero gets cut when saving to the database. -> "1234.1".

The database field is an integer. When i change it to text/varchar the problem is fixed. I wonder if there is another way to fix this, without changing field type in the database.

Kind Regards Michael

Please sign in or create an account to participate in this conversation.