struct DynFork::Fields::F64Field
- DynFork::Fields::F64Field
- DynFork::Fields::Field
- Struct
- Value
- Object
Overview
Field for entering float 64-bit numbers.
Defined in:
dynfork/fields/numbers.crConstructors
- .new(pull : JSON::PullParser)
- .new(label : String = "", default : Float64 | Nil = nil, input_type : String | Nil = "number", placeholder : String = "", max : Float64 | Nil = Float64::MAX, min : Float64 | Nil = Float64::MIN, step : Float64 | Nil = 1.0, hide : Bool = false, unique : Bool = false, required : Bool = false, disabled : Bool = false, readonly : Bool = false, ignored : Bool = false, hint : String = "", warning : Array(String) = Array(String).new)
Instance Method Summary
-
#default : Float64 | Nil
Value by default.
-
#default? : Float64 | Nil | Nil
Value by default.
-
#extract_default_f64 : Float64 | Nil
For the
DynFork::QPaladins::Check#check
method. -
#extract_val_f64 : Float64 | Nil
For the
DynFork::QPaladins::Check#check
method. -
#field_type : String
Field type - Structure Name.
-
#finance_divide(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil
Divide
#value
by some number. -
#finance_minus(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil
Subtract some number to the “value”.
-
#finance_multiply(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil
Multiply
#value
by some number. -
#finance_plus(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil
Add some number to the
#value
. -
#group : UInt8
To optimize field traversal in the
paladins/check()
method. -
#input_type : String | Nil
Html tag: input type="number|range".
-
#input_type? : String | Nil | Nil
Html tag: input type="number|range".
-
#max : Float64 | Nil
The maximum number of characters allowed in the text.
-
#max? : Float64 | Nil | Nil
The maximum number of characters allowed in the text.
-
#min : Float64 | Nil
The minimum number of characters allowed in the text.
-
#min? : Float64 | Nil | Nil
The minimum number of characters allowed in the text.
-
#placeholder : String
Displays prompt text.
-
#readonly=(readonly : Bool)
Specifies that the field cannot be modified by the user.
-
#readonly? : Bool
Specifies that the field cannot be modified by the user.
-
#refrash_val_f64(val : Float64) : Nil
For the
DynFork::QPaladins::Tools#refrash_fields
method. -
#required? : Bool
Required field.
-
#step : Float64 | Nil
Increment step for numeric fields.
-
#step? : Float64 | Nil | Nil
Increment step for numeric fields.
-
#unique? : Bool
The unique value of a field in a collection.
-
#value : Float64 | Nil
Sets the value of an element.
-
#value=(value : Float64 | Nil)
Sets the value of an element.
-
#value? : Float64 | Nil | Nil
Sets the value of an element.
Instance methods inherited from struct DynFork::Fields::Field
choices_from_json(json : String) : Nil
choices_from_json,
disabled=(disabled : Bool)
disabled=,
disabled? : Bool
disabled?,
errors : Array(String)
errors,
errors=(errors : Array(String))
errors=,
field_type : String
field_type,
group : UInt8
group,
hide=(hide : Bool)
hide=,
hide? : Bool
hide?,
hint : String
hint,
id : String
id,
id=(id : String)
id=,
ignored? : Bool
ignored?,
label : String
label,
name : String
name,
name=(name : String)
name=,
slug_sources : Array(String)
slug_sources,
warning : Array(String)
warning,
warning=(warning : Array(String))
warning=
Constructor methods inherited from struct DynFork::Fields::Field
new(pull : JSON::PullParser)
new
Constructor Detail
Instance Method Detail
Divide #value
by some number.
NOTE For secure calculations, BigDecimal
is used.
NOTE Rounded to two decimal places.
NOTE Banikir rounding is used.
NOTE For currencies, use the Money shard.
Example:
model_name = ModelName.new
model_name.amount.value = 12.5
model_name.amount.finance_divide(2)
puts model_name.amount.value # => 6.25
Subtract some number to the “value”.
NOTE For secure calculations, BigDecimal
is used.
NOTE Rounded to two decimal places.
NOTE Banikir rounding is used.
NOTE For currencies, use the Money shard.
Example:
model_name = ModelName.new
model_name.amount.value = 12.5
model_name.amount.finance_minus(6.25)
puts model_name.amount.value # => 6.25
Multiply #value
by some number.
NOTE For secure calculations, BigDecimal
is used.
NOTE Rounded to two decimal places.
NOTE Banikir rounding is used.
NOTE For currencies, use the Money shard.
Example:
model_name = ModelName.new
model_name.amount.value = 12.5
model_name.amount.finance_multiply(2)
puts model_name.amount.value # => 25.0
Add some number to the #value
.
NOTE For secure calculations, BigDecimal
is used.
NOTE Rounded to two decimal places.
NOTE Banikir rounding is used.
NOTE For currencies, use the Money shard.
Example:
model_name = ModelName.new
model_name.amount.finance_plus(12.5)
puts model_name.amount.value # => 12.5
To optimize field traversal in the paladins/check()
method.
WARNING It is recommended not to change.