MCPcopy
hub / github.com/sequelize/sequelize / FLOAT

Class FLOAT

src/data-types.js:283–297  ·  view source on GitHub ↗

* Floating point number (4-byte precision).

Source from the content-addressed store, hash-verified

281 * Floating point number (4-byte precision).
282 */
283class FLOAT extends NUMBER {
284 /**
285 * @param {string|number} [length] length of type, like `FLOAT(4)`
286 * @param {string|number} [decimals] number of decimal points, used with length `FLOAT(5, 4)`
287 */
288 constructor(length, decimals) {
289 super(typeof length === 'object' && length || { length, decimals });
290 }
291 validate(value) {
292 if (!Validator.isFloat(String(value))) {
293 throw new sequelizeErrors.ValidationError(util.format('%j is not a valid float', value));
294 }
295 return true;
296 }
297}
298
299/**
300 * Floating point number (4-byte precision).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected