community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Condition output whole number

Meteoroid
Hello, I am trying to create a workflow that will output whole trade prices (ie 126.35312) and if fractional price is present, will convert fraction price to whole price (ie 126-11.3). 126-11.3 (fractional number) (11.3/32 = .35312) 126.35312 (whole price) Thank you!
Highlighted
Pulsar

Hi @beattyb 

 

If you're always dividing by 32 in the fractional number, you can try this formula in a Formula tool. Create a new field with a double data type:

 

IF Contains([number],"-") THEN tonumber(left([Number],findstring([number],"-")))+tonumber(right([Number],length([number])-FindString([Number], "-")-1))/32
ELSE [Number]
ENDIF

 

Let me know if that helps!

 

Cheers,

Esther

Meteoroid
I'm assuming where you have [Number] would be the field for price?
Labels