Notion Answers

Help between Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

3votes

Number with Commas Not Working

I'm a newbie and can't figure out how to get a comma added to this formula: ": " + format(prop("Views"))

Views is a number being pulled from YouTube API. When it comes into notion I have it set to display as number with commas. It looks like this: 1,000 But since it doesn't include a label of what the number is, I created another formula property "View Label" which you see above. But it doesn't bring the comma over. It looks like this: : 1000 Someone suggested I use replaceALL but no idea how to add it to the formula I've got.

2 Answers

2votes

chickspirit Points260

Actually it is possible the tutorial I followed had them in there.
But thank you for posting because that made me go back and revisit the steps. Turns out the formula to get the comma is at the very bottom of the tutorial.

Here it is in case anyone else ever needs it...

": " + replace(replace(format(prop("Views")), "(\\d{1})(\\d{3})$", "$1,$2"), "(\\d{1})(\\d{3},\\d{3})", "$1,$2")

1vote

polle commented

Thank you for sharing!

You are replacing there and if your numbers are not more than 9 digits that will work fine, but for natural results converting to text (without replacing), commas are not supported in the formula result.

Please select your answer to mark the question as solved.

2votes

chickspirit commented

@polle Thank you for the clarification.
What happens if it's more than 9 digits?

2votes

polle commented

It will stop working and you will have to create a new formula to keep replacing, that is why it is important to know it is not a natural from number to text formula.

1vote

polle Points81400

You are doing it correctly.

Commas in Notion formulas when you convert numbers to text are not supported at the moment. Hopefully Notion implements this in the future.

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect