* Floating point number (4-byte precision).
| 281 | * Floating point number (4-byte precision). |
| 282 | */ |
| 283 | class 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). |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…