Home > database >  Converting a value to Currency
Converting a value to Currency

Time:12-20

this seems like a simple fix but I'm stuck. I have a list of values ex: 8564899 that should be displayed as 85,648.99 and NOT 8,564,899. If I can't convert to currency. I would just like to cut the last two values off. Any assistance is appreciated. Thank you!

I've tried the following solutions:

FORMAT(Value, 'F')
ROUND(Value, 2)
STR(Value, 7, 2)
CONVERT(DECIMAL(7,2), Value)

CodePudding user response:

SELECT concat(substring(Value, 1, length(Value)-2), ".", substring(Value, -2, 2)) as numWithDecimal

Maybe like this to cut the value

CodePudding user response:

Convert to string

CONVERT(Value,char)

And insert the '.' on the position in the string that you want

  • Related