struct

DynFork::Fields::F64Field

Inherits DynFork::Fields::Field < JSON::Serializable < Struct < Value < Object

Field for entering float 64-bit numbers.

Constructors

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)
Source

Instance methods

default

Value by default.

Source
default?

Value by default.

Source
extract_default_f64

For the DynFork::QPaladins::Check#check method.

Source
extract_val_f64

For the DynFork::QPaladins::Check#check method.

Source
field_type

Field type - Structure Name.

Source
finance_divide(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil

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
Source
finance_minus(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil

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
Source
finance_multiply(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil

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
Source
finance_plus(num : Float | Int | BigInt | BigRational | BigDecimal | String) : Nil

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
Source
group

To optimize field traversal in the paladins/check() method. WARNING: It is recommended not to change.

Source
input_type

Html tag: input type="number|range".

Source
input_type?

Html tag: input type="number|range".

Source
max

Maximum allowed number.

Source
max?

Maximum allowed number.

Source
min

Minimum allowed number.

Source
min?

Minimum allowed number.

Source
placeholder

Displays prompt text.

Source
readonly=(readonly : Bool)

Specifies that the field cannot be modified by the user.

Source
readonly?

Specifies that the field cannot be modified by the user.

Source
refrash_val_f64(val : Float64) : Nil

For the DynFork::QPaladins::Tools#refrash_fields method.

Source
required?

Required field.

Source
step

Increment step for numeric fields.

Source
step?

Increment step for numeric fields.

Source
unique?

The unique value of a field in a collection.

Source
value

Sets the value of an element.

Source
value=(value : Float64 | Nil)

Sets the value of an element.

Source
value?

Sets the value of an element.

Source