cancel
Showing results for 
Search instead for 
Did you mean: 

How to manipulate a number from a string

Former Member
0 Kudos

Hi All

I am using CRXI and have designed a report that will list all of our fleet starting with the 'Fleet No.' The fleet no. field is a string so that the fleet no.s weren't displaying in numerical order. I converted the field to a number and it then worked fine. Now, of course, the boffins have decided to create new fleet no's '7110.1'. With the field being a number these weren't displaying on my report. I thought if I played with the 'decimal points' that would help. My report now has '101.0' instead of '101' as well as displaying '7110.1'. Is there a formula to suppress the decimal point if it is zero?

Thanks in advance for your help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please try this:

1. Right click on the field (formula field for FleetNo - {@numFleetNo})

2. Select Format field.

3. Select the Number Tab

4. Click on Customize...

Write the following formula in front of Decimals and Rounding by clicking on X-2 editor of both.

if {@numFleetNo} - Floor ({@numFleetNo}) = 0 then

0

Else

1

Hope this will help.

Former Member
0 Kudos

Hi Vicky

Worked perfectly!! Thanks very much

Answers (0)