Author Topic: how to round a result to 2 decimal places ?  (Read 1017 times)

Septimanien

  • Newbie
  • *
  • Posts: 5
how to round a result to 2 decimal places ?
« on: November 06, 2021, 02:02:12 PM »
Hello !

I've got something like :

Say,"Speed{EXP:{CMDSEGMENT:3}/{CMDSEGMENT:1}*1.96} knots"

how to round a result to 2 decimal places ?
is it possible to round 4.08 to 4.1 for example?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: how to round a result to 2 decimal places ?
« Reply #1 on: November 06, 2021, 02:05:01 PM »
The "Set a Decimal Value" action has a built-in rounding option. You can pass it the output of the "{EXP:}" token, have it set a variable to the rounded value, then use the "{DEC:}" token to retrieve that value in your "Say Something with Text-To-Speech" action.