Formatting formulas on the canvas

is there a way to force the format formulas on the canvas? i’m trying to display a quick ratio by dividing two currency columns. it’s displaying as a decimal and i’m wanting it represented as a percentage.

2 Likes

I have the same question.
Anybody some idea?

After some searching, I found a rather elaborate workaround:

concatenate(format("{1:00.0}",totext([Rendement Actual]/[Rendement Estimate]*100)),"%")

gives 78.9% as result.

1 Like

Hi @Stefaan_Dumez,
good point.

And even more compact:
Format("{1:00.0}%",[Rendement Actual]/[Rendement Estimate]*100)
i.e. in the Format() function you can put variables and text (therefore, no need of Concatenate() and ToText()).

4 Likes

Dear @Federico_Stefanato,

Thank you pointing out the benefits that “format()” includes.
Especially for people without a “coding background”, like me, it’s rather important to be aware of this :diamond_shape_with_a_dot_inside:

1 Like

Hi @Federico_Stefanato,

do you know is there is a more complete formula description than @ https://coda.io/formulas ?

The latter clearly doesn’t cover all the richness of the formula language.

Hi @Stefaan_Dumez,
unfortunately, not (yet).

I heard that a more comprehensive reference will be on radar (hopefully with a playground), but so far is all that we have.

The problem with both our solutions: it returns a string => can’t calculate with it…
I just forget about the % in the formula.
I type it on the canvas after the formula.
It’s always there and formula returns a number that can be used in calculations.

Problem solved as far as I’m concerned.

Thanks for the help.

I see your point.
I didn’t know that was a formula referenced elsewhere.

In this case you can put the value in an intermediate Named Formula so that you can use it both on other computations and in the formatting.

But I guess this is exactly what you have done. :wink:

that DID solve my use case however- thanks all!

@Stefaan_Dumez @Federico_Stefanato
If you needed to refer to the number from this string, you could also convert it to a value in the formula you are using to include this parameter in:

e.g.
Rendement % Formula On Canvas = Format(“{1:00.0}%”,[Rendement Actual]/[Rendement Estimate]*100)

Now I want to subtract the progress % from this value, so I the formula would be:

=value(@[“Rendement % Formula On Canvas”]) - [Progress %]

Hi @Kolbi_Christianson,

thanks for your feed-back. Some questions from a Newbie:

I can’t find the value() function. Do you mean ToNumber()?
Why the @ before the variable?

@Stefaan_Dumez @Alex_Parks
I have a lot of corrections to make to my statement!! I was totally wrong!

So,

  1. Make your formula:

= Format(“{1:00.0}%”,[Rendement Actual]/[Rendement Estimate]*100)
this returns: 68.2%, for example

  1. Name that formula as “Rendement%”
  2. Refer to that number in another part of the canvas by:

=format(“{1:00.0}%”,Format(“{1:00.0}%”,tonumber([Rendement%])*[whatever you want]))
where if [whatever you want] = 25%
you get 17.1%

I should have tested my response before sending it, apologies for the misinformation.

I’m happy to share that Coda now support canvas formula formatting for Number, Date and People results! This means you no longer have to use the Format() formula here to do your percentage display

8 Likes

great!.
still no support for more currency symbols? (i.e. Philippine/Mexican Peso and etc.)

This was much needed, thank you.

Sorry, not supported just yet – are there any specific currencies (other than Peso) that you’re looking for?

Dear @chrisquim ,

For the time being, this post explains a way around with the format() formula.
Although a bit more work, but more flexibility.


A wider support list suggestion :slight_smile:

(PS: it appears it’s quite more multiple countries uses Peso currency :slight_smile: )

(Edit: It appears only Philippine Peso uses the currency symbol ₱ . other peso uses dollar symbol. regardless, symbol support is appreciated for such and while also other country that uses other symbol) :slight_smile:

1 Like

Thanks for sharing, I’ll pass this along to the team!

1 Like