We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c89c55 commit 2903b89Copy full SHA for 2903b89
1 file changed
adminforth/dataConnectors/postgres.ts
@@ -214,8 +214,19 @@ class PostgresConnector extends AdminForthBaseConnector implements IAdminForthDa
214
}
215
216
if (field.type === AdminForthDataTypes.DECIMAL) {
217
- const parsed = Number(value);
218
- return isNaN(parsed) ? value : parsed;
+ if (value !== null && value !== undefined) {
+
219
+ if (value.includes('.')) {
220
221
+ let trimmed = value.replace(/0+$/, '');
222
223
+ if (trimmed.endsWith('.')) {
224
+ return trimmed.slice(0, -1);
225
+ }
226
+ return trimmed;
227
228
229
+ return value;
230
231
232
if (field.type == AdminForthDataTypes.DATE) {
0 commit comments