Skip to content

Decimal different from MySQL to PostgreSQL #1964

@jValdron

Description

@jValdron

Decimals seems to return a string under PostgreSQL, but in MySQL, it returns a float. Using this definition:

front_bumper_estimate: {
    type: sequelize.DECIMAL(10, 2),
    allowNull: true,
    validate: {
        isDecimal: true
    }
}

It returns front_bumper_estimate: "125.00" using PostgreSQL but front_bumper_estimate: 125.00 in MySQL. Is there any way to force it to parse it to a float under PostgreSQL?

EDIT: For the moment, I'm just going to add a getter that parses the string to a float.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions