DynFork::Fields::F64Field
Inherits DynFork::Fields::Field < JSON::Serializable < Struct < Value < Object
Field for entering float 64-bit numbers.
Constructors
Instance methods
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.