Skip to content
Flags & Debug enableDecimals

$enableDecimals

The $enableDecimals function enables decimal display in calculations for the current command.

Syntax

bdfd
$enableDecimals

Syntax

$enableDecimals

Parameters

None.

Return value

None.

Behavior

  • Without $enableDecimals, BDFD rounds the results of $calculate[].
  • With $enableDecimals, the results include decimals.
  • The effect is limited to the current command.

Examples

Calculation with decimals

$enableDecimals
$sendMessage[10 ÷ 3 = $calculate[10/3]]
; Displays: 10 ÷ 3 = 3.3333333333333335

Without decimals (default)

$sendMessage[10 ÷ 3 = $calculate[10/3]]
; Displays: 10 ÷ 3 = 3

Comparison before/after

$var[without;$calculate[10/3]]
$enableDecimals
$var[with;$calculate[10/3]]
$sendMessage[Without: $var[without] | With: $var[with]]

Notes

  • Place before the calculations concerned.
  • To round to N decimals, use $round[$calculate[...];N].
  • Also affects divisions in $if[] conditions.