Changing the display of a number

Hi all,

Would anybody know an expression that would help to change a number?
For example:
16,484 to show as 16.5k ?

I would like the figure to be rounded to the nearest hundredth and then replace the last two digits with a “k”.

To mention that this would not replace the actual number field but be shown in a VC.

Thanks in advance,
Chris.

Solved Solved
0 7 406
1 ACCEPTED SOLUTION

Please try this

CONCATENATE(DECIMAL(ROUND([ShortenNumber]/100.0)/10.0),“K”)

I believe this will work for a range from 50 to 99999

A number will last two digits lesser than 50 ( 1234 , 2345, 22335) will convert to earlier 100
A number with last two digits greater than 49 (1256, 2567, 45678) will convert to higher 100

The field [ShortenNumber] is the field that will contain numbers 50 to 99999

View solution in original post

7 REPLIES 7

This is a rounding issue, I think. I think you will need a combination of dividing by 1000, rounding, and then using CONCATENATE() to and the “k”, etc. (perhaps not necessarily in that order). See the following discussion:

Maybe something like this, but is not very good looking since I am still learning to use numbers:

CONCATENATE(CEILING(10*(16,484/1000.0))/10.0,"k")

Please try this

CONCATENATE(DECIMAL(ROUND([ShortenNumber]/100.0)/10.0),“K”)

I believe this will work for a range from 50 to 99999

A number will last two digits lesser than 50 ( 1234 , 2345, 22335) will convert to earlier 100
A number with last two digits greater than 49 (1256, 2567, 45678) will convert to higher 100

The field [ShortenNumber] is the field that will contain numbers 50 to 99999

Hi guys,

I have tested all of these 3 solutions and all of them work great.

@Kirk_Masden’s solution of using the rounding to 500th worked but was a little too far out for me.

@Heru’s solution worked great also and so does the solution @Suvrutt_Gurjar suggested.

Results are below:

2X_4_4ffc256753a5809f97dbc817abd910179581a422.png

The solution I will go ahead and use is @Suvrutt_Gurjar’s as it is accurate and is just what I am looking for.

Thanks all for your suggestions and solutions.

Best,
Chris.

Hi @Chris_Jeal,

Good to know it meets your requirement. My request will be to test it well at your end as well , eventhough I also tested with around 15 odd different number combinations from 50 to 99999

Just have done, the numbers we work with will never reach the 99,999 so I’m pretty safe with this expression.

2X_0_07879005b9fa9de4e163cbc248283ffbf6ffcee6.png

Looks great!

Thanks again.

Hi @Chris_Jeal, I really like this comparison. Thanks for sharing with us.

Top Labels in this Space