ソースを参照

fix(core): Fix "float" customField types

Upgrading TypeORM introduced a change which forced "float" default values to be rounded.
Michael Bromley 4 年 前
コミット
b4dc9126ca
1 ファイル変更3 行追加0 行削除
  1. 3 0
      packages/core/src/entity/register-custom-entity-fields.ts

+ 3 - 0
packages/core/src/entity/register-custom-entity-fields.ts

@@ -92,6 +92,9 @@ function registerCustomFieldsForEntity(
                         }
                         options.length = length;
                     }
+                    if (customField.type === 'float') {
+                        options.scale = 2;
+                    }
                     if (
                         customField.type === 'datetime' &&
                         options.precision == null &&