Revision
So you think you can count
Round and other functions
20. Function trunc – practice
Revision and practice

Instruction

Good. The last but not the least, function to practice is trunc(x). It always round towards zero.

Exercise

Show the character's name together with its stat_modifier, followed by the stat_modifier rounded with the function trunc(x,p) to a single decimal place. Observe how it behaves for positive and negative numbers.

Stuck? Here's a hint!

Use trunc(stat_modifier, 1).

Console

Code editor

Result

TableConsole