-1

How to remove the trailing 0000 with a sql expression? for example, 1.0100000 - what I need is 1.01 after running it, thanks in advance!

Tobb
  • 11,850
  • 6
  • 52
  • 77
markit
  • 1

1 Answers1

1

If you don't want your numbers to be rounded (just ignore the last decimals), use the TRUNCATE function:

TRUNCATE(1.23456, 4) --yields 1.2345

If you want your number to be rounded, use the ROUND function:

ROUND(1.23456, 4) --yields 1.2346
Tobb
  • 11,850
  • 6
  • 52
  • 77