Solved

Remove Trailing Zeros from Amount

  • 6 February 2023
  • 6 replies
  • 66 views

Badge +4

Hello Team,

I have amount field that can have values like below 

123.450

123.400

123.456

123.000

I have to remove the trailing zeros and the result should be like below:

123.450 = 123.45

123.400 = 123.4

123.456 = 123.456

123.000 = 123

Can you please help here.

 

 

 

 

icon

Best answer by ChanduMohammad 6 February 2023, 18:51

View original

6 replies

Userlevel 3
Badge +6

https://regex101.com/r/mD7gK4/7

Badge +4

@Sumit.K7 , thanks for the response. Just one thing here, when the input is 1.0, we need response as 1 instead of 1.0

Userlevel 3
Badge +6

Use this : Replace text matching following regex with empty values

\.?0+$

https://regex101.com/r/lKmsde/1

Userlevel 5
Badge +12

Hi @Ankith K 

Checkout below solution,

Note: In Replace With add a space by keying in space bar from your keyboard

 

Badge +4

Thank you guys for your prompt support, this really helped. 

Userlevel 5
Badge +12

Thank you guys for your prompt support, this really helped. 

Amazing @Ankith K 

Reply