Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7187705
float.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
650 B
Referenced Files
None
Subscribers
None
float.ts
View Options
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
Details
Attached
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)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment