Round Function Alternative
Hi, I have a question regarding decimal places in Domo. It seems that the built in Domo formatting options are designed to truncate, v.s. the MYSQL function ROUND. I would like to have some consistency with how my cards looks and I have a specific example where I need to use Truncate(which does not exist as a MYSQL function in my instance). EX: I am using a beastmode to display percentages concatenated with words so I cannot use the built in formatting options
As you can see in the screenshot when using ROUND function it rounds the value to display as 10% however when using the built in formatting options it displays as 10.0%. This is how I want it to display using a beastmode. If there is a workaround please help.
Thank you,
Answers
-
You can use the ROUND function to specify the number of decimal places you want in your resulting value.
ROUND(`Percentage`, 1)
This would get you one decimal place. By default if you don't have the second argument it defaults to 0.
If you're wanting to truncate you can use the
FLOOR
method to drop everything after the decimal place.**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Hi Grant,
I am using the function as you describe above(Round(
Percentage
,1), however it is rounding 10.0% to display as 10%. I would like a way to display it as 10.0% percent also, the FLOOR method you describe does not seem like it would allow it to display as 10.0% either? Correct me if I am wrong.Thanks
0 -
If you look at the raw data is it showing 10 or 10.0? Are you able to click on the field in the card, select format - percentage and then set the percentage decimals to 1? What type of card are you utilizing to display your 10%?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Hi, the it is a calculated field with a numerator and a denominator to give me the percentage so it should show as 10.0%. I cannot use the built in formatting options in this case because I am concatenating it with text and using it as a summary number beastmode. I am using it as the summary number in a bar chart.
0 -
If it's returning the string value of 10.0% then it shouldn't be doing any formatting. When you select it in your column list in analyzer is it listed under dimensions (blue) or metrics (green)?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
It is a beastmode and it is blue. It seems to happen only when the number after the decimal place is 0. Another example is 24.03%. If I use round(24.03%,1) to get 1 decimal place it rounds it to be 24% not 24.0%.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive