Percentage Math (Float)

BlockMath

Add or subtract a percentage to/from a floating point number.

Inputs

ValueRequired

Base float value.

Example: 199.99

PercentageRequired

Percentage to apply (e.g. 15.5 for 15.5%).

Example: 15.5

OperationRequired

Add or subtract the percentage.

OptionsAdd PercentageSubtract Percentage

Outputs

Result

Resulting value after applying the percentage.

Example: 169.99

Build a bot using blocks like Percentage Math (Float)

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: percentage_math_float
  • Value block: it can be used directly inside expressions, e.g. "Result: " + percentage_math_float(Args{...}).

Inputs

FieldInventScript nameValue
Valuevaluee.g. "199.99"
Percentagepercentagee.g. "15.5"
Operationoperation"Add Percentage", "Subtract Percentage"

Outputs

FieldInventScript nameValue
Resultresulte.g. "169.99"

Example InventScript

percentageMathFloat := percentage_math_float(Args{
	value:      199.99,
	percentage: 15.5,
	operation:  "Subtract Percentage",
})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Result: " + percentageMathFloat,
})

More math blocks