Alteryx Designer Desktop Discussions

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

Condition output whole number

beattyb
6 - 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!
2 REPLIES 2
estherb47
15 - Aurora
15 - Aurora

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

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