0

This is my code running on Vertica server on DB Visualizer.

@echo ${Margin||77.5||decimal(5,2)||where noshow}$; 

When I run this line, I'm getting '77' as my value instead of '77.5'.

select ${Margin}$ + 0

Could someone please tell me how to NOT round off my variable? I need it to be accurate.

fthedevs
  • 43
  • 1
  • 7

1 Answers1

0

You could try:

select ${Margin}$ + 0.00

Sometimes, compilers cast a result based on the literal values in the statement, so, since 0 would be considered an INT, the result is probably being cast to an INT. By making the literal a float, it might make the result a float and not truncate.

Michael Dougan
  • 1,698
  • 1
  • 9
  • 13