02-18-2011, 10:34 PM
(This post was last modified: 02-18-2011, 10:43 PM by Brian.Osborne.)
I need to force a number to have decimal places so I can split it.
Here is the scenario.
I have a term in months ranging from 1 to 480. I need to split this into years and months.
This is what I have...
This issue is that when the number is divisible by 12 qtp takes off the decimal so the split fails.
Any way around this problem?
I've searched these boards and several others with nothing I've tried working. Looking for a creative solution.
Here is the scenario.
I have a term in months ranging from 1 to 480. I need to split this into years and months.
This is what I have...
Code:
TermYears = Term/12
myTermSplit = Split(TermYears, ".")
myNewTermYears = myTermSplit(0) & myTermSplit(1)
TermYears = mySplit(0)
TermMonths = mySplit(1)*12
This issue is that when the number is divisible by 12 qtp takes off the decimal so the split fails.
Any way around this problem?
I've searched these boards and several others with nothing I've tried working. Looking for a creative solution.