Page MenuHomeSealhub

float.ts
No OneTemporary

float.ts

import { Field } from "../../../main";
/** Stores a floating point number. DOes not take params. Does not allow range filtering. @todo: add range filtering */
export default class Float extends Field {
typeName = "float";
async isProperValue(_: any, input: number) {
const test = parseFloat(input.toString());
if (test === null || isNaN(test) || isNaN(input) === true) {
return Field.invalid(
`Value '${input}' is not a float number format.`
);
} else {
return Field.valid();
}
}
async encode(_: any, value_in_code: number | string) {
const parsed_float = parseFloat(value_in_code.toString());
return parsed_float;
}
}

File Metadata

Mime Type
text/x-java
Expires
Tue, Jul 8, 07:02 (3 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
801641
Default Alt Text
float.ts (650 B)

Event Timeline