Skip to content

EspoCRM – Open Source CRM Application

fix schema diff for decimal

Yuri Kuznetsov36f03f0a766b
diff --git a/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php b/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php
index 4210ab5285..e3428c1ba8 100644
--- a/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php
+++ b/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php
@@ -85,8 +85,10 @@ class Currency implements FieldConverter
$defaultValue = $fieldDefs->getParam(AttributeParam::DEFAULT);
- if ($defaultValue !== null) {
- $amountDefs = $amountDefs->withParam(AttributeParam::DEFAULT, (string) $defaultValue);
+ if (is_int($defaultValue) || is_float($defaultValue)) {
+ $defaultValue = number_format($defaultValue, $scale, '.', '');
+
+ $amountDefs = $amountDefs->withParam(AttributeParam::DEFAULT, $defaultValue);
}
}