# Cannot convert value of type string to a decimal Cakephp 4.3

**URL:** <https://discourse.cakephp.org/t/cannot-convert-value-of-type-string-to-a-decimal-cakephp-4-3/9978>\
**Category:** Need Help\
**Tags:** help\
**Created:** [December 12, 2021, 1:56am UTC](https://discourse.cakephp.org/t/cannot-convert-value-of-type-string-to-a-decimal-cakephp-4-3/9978 "2021-12-12T01:56:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![theasy](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@theasy](https://discourse.cakephp.org/u/theasy)\
**Post date:** [December 12, 2021, 1:56am UTC](https://discourse.cakephp.org/t/cannot-convert-value-of-type-string-to-a-decimal-cakephp-4-3/9978/1 "2021-12-12T01:56:39Z")

</div>

how can i properly debug this bug? the data come from an input field via request … what can I do?

Cakephp 4.3

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [December 12, 2021, 4:41am UTC](https://discourse.cakephp.org/t/cannot-convert-value-of-type-string-to-a-decimal-cakephp-4-3/9978/2 "2021-12-12T04:41:34Z")

</div>

More information is definitely needed here. What specific line of code is causing this error? A full stack trace would be ideal.

---

<div class="post-metadata">

**Author:** ![theasy](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@theasy](https://discourse.cakephp.org/u/theasy)\
**Post date:** [December 12, 2021, 2:07pm UTC](https://discourse.cakephp.org/t/cannot-convert-value-of-type-string-to-a-decimal-cakephp-4-3/9978/3 "2021-12-12T14:07:01Z")

</div>

thanks for the quick reply, what is the best way to post the full stack of trace here? the error output comes with every save call whether single or … many or … manyOrFail

# Cannot convert value of type `string` to a decimal

InvalidArgumentException

CORE/src/Database/Type/DecimalType.php Toggle Arguments

| | ` ) {` |
| --- | --- |
| | ` return strval($value);` |
| | ` }` |
| | `` |
| | ` throw new InvalidArgumentException(sprintf(` |
| | ` 'Cannot convert value of type`%s` to a decimal',` |
| | ` getTypeName($value)` |
| | ` ));` |
| | ` }` |

the DB table field is DECIMAL

thanku for help

---

<div class="post-metadata">

**Author:** ![ADmad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/admad/32/20_2.png) [@ADmad](https://discourse.cakephp.org/u/ADmad)\
**Post date:** [December 13, 2021, 2:19pm UTC](https://discourse.cakephp.org/t/cannot-convert-value-of-type-string-to-a-decimal-cakephp-4-3/9978/4 "2021-12-13T14:19:43Z")

</div>

You are passing a string which cannot be stored as decimal. I assume you are from a region which uses some character besides dot as decimal place separator. If so you should enable locale based parsing.

---

<div class="post-metadata">

**Author:** ![theasy](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@theasy](https://discourse.cakephp.org/u/theasy)\
**Post date:** [December 14, 2021, 11:15am UTC](https://discourse.cakephp.org/t/cannot-convert-value-of-type-string-to-a-decimal-cakephp-4-3/9978/5 "2021-12-14T11:15:00Z")

</div>

thanks for the tip … it seems to be relatively complicated, I’ll try 🙂
