It is possible to use 4Test's mulitple string manipulation methods and work with values that have more than six decimal points.

A user can convert a number to a string, count how many decimal points are actually used and mulitply the decimal places out - then use the numbers as whole numbers without decimal places. When any comparisons are made using the new whole values - the decimal places can be added back in.

In the below example we are finding the difference between two values with the same number of decimal places:

[+] testcase compareNumbers () appstate none
 [ ] // this testcase mulitplies the decimal places out - so we are dealing with whole numbers
 [ ] // the comparison is made between the two whole numbers
 [ ] // the result of the comparison is divided by the same value to add the decimal places back in
 [ ]
 [ ] NUMBER n1, n2, n1Converted, n2Converted, nResult
 [ ]
 [ ] // the two sample Numbers
 [ ] n1 = 10.22345676
 [ ] n2 = 10.12345665
 [ ]
 [ ] //multiply to remove the decimal point
 [ ] n1Converted = n1 * multiplyvalue(CountDecimalPlaces(n1))//10000000
 [ ] n2Converted = n2 * multiplyvalue(CountDecimalPlaces(n2))//10000000
 [ ]
 [ ] // perform the calculation using the converted numbers
 [ ] nResult = n1Converted - n2Converted
 [ ]
 [ ] // add the decimal points and return as a string
 [ ] String s1 = Str(nResult/multiplyvalue(CountDecimalPlaces(n1)),2,CountDecimalPlaces(n1))
 [ ]
 [ ] // print the result
 [ ] Print(" {n1}  - {n2} = {s1}")

[+] int CountDecimalPlaces (real rOne)
 [ ] // uses 4Test string manipluation in order to count the number of decimal places
 [ ]
 [ ] String sOne = Str(rOne, 2,12) // specified 20 here as the maximum number of decimal points
 [ ] String sTwo,sTemp
 [ ] sTwo = GetField (sOne, ".",2)
 [ ]
 [ ] int iAfterDP = Len(sTwo)
 [ ]
 [ ] boolean bNotZero = FALSE
 [ ]
 [-] while (!bNotZero)
  [-] if (Right(sTwo,1) == "0")
   [ ] iAfterDP = iAfterDP-1
   [ ] sTemp = Left(sTwo, iAfterDP)
  [-] else
   [ ] sTemp = Left(sTwo, iAfterDP)
   [ ] bNotZero = TRUE
  [ ] sTwo = sTemp
 [ ] return Len(sTwo)

[+] int multiplyvalue(int numberofplaces)
 [ ] // this function returns the number to multiply and divide by before comparing values
 [ ] int i
 [ ] int iVal = 10
 [ ]
 [+] for (i=1;i<>
  [ ] iVal = iVal * 10
 [ ]
 [ ] return iVal