How to Hide Decimal when decimal was zero or 0, show when decimal higher than 0 ?

Hi mate, 

does anyone can help me how to get rid or hide decimal if it zero ?

only show if the number was above 0.

on image that i post, i have Qty Column, can i hide the .0 number ?

show only if the number was eg. 7.5 or 10.9 ?

1.png

Solved Solved
0 4 189
2 ACCEPTED SOLUTIONS

I'm not aware of a formatting that allows to do so.

You may want to add a new virtual column that will display the [YourDecimal] or NUMBER([YourDecimal]), such as this:

IF(MOD([yourDecimal],1)>0,
  [yourDecimal],
  NUMBER([yourDecimal])
)

Please note such column should be with type Text.

View solution in original post

Thanks Aurelien for your help.

it help me for my case but it need a little modification.

Change Number([yourDecimal]) With Decimal([yourDecimal])

 

And i use text virtual column.

Eg :

 

IF(MOD([Qty],1)>0,
  [Qty],
  Decimal([Qty])
)

 

 

View solution in original post

4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @RickyJ 

 

You may want to apply a Show_If condition to your column.

Aurelien_0-1662370297973.png

 

Aurelien_1-1662370320922.png

 

I suggest:

[_THIS]<>0.0

 

My view was different, i mean if there is no decimal, just show the number without point decimal.

eg: If number qty was 8.0 only show 8. if 6.2 show 6.2.

If - Show

6.0 - 6

10.0 - 10

11.5 - 11.5

6.2 - 6.2

8.0 - 8

I'm not aware of a formatting that allows to do so.

You may want to add a new virtual column that will display the [YourDecimal] or NUMBER([YourDecimal]), such as this:

IF(MOD([yourDecimal],1)>0,
  [yourDecimal],
  NUMBER([yourDecimal])
)

Please note such column should be with type Text.

Thanks Aurelien for your help.

it help me for my case but it need a little modification.

Change Number([yourDecimal]) With Decimal([yourDecimal])

 

And i use text virtual column.

Eg :

 

IF(MOD([Qty],1)>0,
  [Qty],
  Decimal([Qty])
)

 

 

Top Labels in this Space