MIP Logo

Formatting issue with decimals as a string

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

Tableau seems to have a little bit of an issue when you try to do a calculation that rounds a float and then converts it into a string.
eg. STR( ROUND ( [measure] , 1) ) can return 2.7999… instead of 2.8.

The fix? Wrap the measure in ATTR( ) function.
eg. STR( ROUND ( ATTR ( [measure] ), 1) )

This should fix the issue.

Share this post