cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal question

Former Member
0 Kudos

Cr 2008, SQL Server 08

I have a string field that holds values like 1.0, 2.5, 5.0.

What I need to do is if the decimal is a 0 then only display the whole number and strip of the .0, if it is like 2.5 then display 2.5.

I have not figured out how to do this.

thanks,

GJ

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

if split({stringfield},'.')[2] = '0' then split({stringfield},'.')[1] else {stringfield};
Former Member
0 Kudos

Thanks

that worked

GJ

Answers (0)