Skip to content
Advertisement

MySql format number with space as thousand delimiter and no decimal zeros

Having the number: 103,648.340 format it to be as the expected result

Expect result: 103 648.34

My progress:

  1. TRIM remove decimal zeros, so I’ve 103,648.34
  2. FORMAT add thousand delimited by space, so I’ve 103 648.340

I’ve tried to combine TRIM with FORMAT without success

Advertisement

Answer

Try this solution:

DEMO

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement