Я пытаюсь выполнить деление с помощью оператора /
.
Полученное число с плавающей запятой находится далеко от цели.Что я пропустил?
Это вывод из RF:
KEYWORD: BuiltIn.Log ${nearTermsAmount}
Documentation:
Logs the given message with the given level.
Start / End / Elapsed: 20190527 17:13:09.091 / 20190527 17:13:09.107 /
17:13:09.107 INFO 3,666.00
00:00:00.000 KEYWORD: BuiltIn.Log ${nearAllIn}
Documentation:
Logs the given message with the given level.
Start / End / Elapsed: 20190527 17:13:09.107 / 20190527 17:13:09.107
17:13:09.107 INFO 1.607976
00:00:00.015 KEYWORD: ${calNearTerms/BaseAmount} = BuiltIn.Run Keyword If ${isBase}, Calculate Terms Amount, ${nearBaseAmount}, ${nearAllIn}, ELSE, Calculate Base Amount, ${nearTermsAmount}, ${nearAllIn}
Documentation:
Runs the given keyword with the given arguments, if `condition` is true.
Start / End / Elapsed: 20190527 17:13:09.107 / 20190527 17:13:09.122 / 00:00:00.015
00:00:00.015 KEYWORD: rateTicketKeywords.Calculate Base Amount ${nearTermsAmount}, ${nearAllIn}
Documentation:
Calculates the base amount out of the given rate
Start / End / Elapsed: 20190527 17:13:09.107 / 20190527 17:13:09.122 / 00:00:00.015
00:00:00.000 KEYWORD: ${baseAmount} = BuiltIn.Evaluate ${givenAmount} / ${givenRate}
00:00:00.015 KEYWORD: ${result} = rateTicketKeywords.Strip Numeric Commas ${baseAmount}
00:00:00.000 KEYWORD: ${result} = BuiltIn.Convert To Number ${result}, 5
17:13:09.122 INFO ${calNearTerms/BaseAmount} = 3414.18529
00:00:00.016 KEYWORD: ${otherAmount} = BuiltIn.Run Keyword If ${isBase}, Strip Numeric Commas, ${nearTermsAmount}, ELSE, Strip Numeric Commas, ${nearBaseAmount}
Documentation:
Runs the given keyword with the given arguments, if `condition` is true.
Start / End / Elapsed: 20190527 17:13:09.122 / 20190527 17:13:09.138 / 00:00:00.016
00:00:00.016 KEYWORD: rateTicketKeywords.Strip Numeric Commas ${nearBaseAmount}
17:13:09.138 INFO ${otherAmount} = 2279.88
00:00:00.000 KEYWORD: ${diff} = BuiltIn.Evaluate ${calNearTerms/BaseAmount} - ${otherAmount}
00:00:00.000 KEYWORD: ${diff} = BuiltIn.Evaluate abs(${diff})
Documentation:
Evaluates the given expression in Python and returns the results.
Start / End / Elapsed: 20190527 17:13:09.138 / 20190527 17:13:09.138 / 00:00:00.000
17:13:09.138 INFO ${diff} = 1134.30529
00:00:00.000 KEYWORD: ${diff} = BuiltIn.Evaluate ${diff} / ${otherAmount}
Documentation:
Evaluates the given expression in Python and returns the results.
Start / End / Elapsed: 20190527 17:13:09.138 / 20190527 17:13:09.138 / 00:00:00.000
17:13:09.138 INFO ${diff} = 0.497528505886
00:00:00.000 KEYWORD: ${status} = BuiltIn.Evaluate ${diff} > 0.0006
00:00:00.015 KEYWORD: BuiltIn.Run Keyword If ${status}, FAIL, the calculated near terms amount which was inserted in the trade ticked differ to the near terms amount from the execution dialog, True
Documentation:
Runs the given keyword with the given arguments, if `condition` is true.
Start / End / Elapsed: 20190527 17:13:09.138 / 20190527 17:13:09.153 / 00:00:00.015
00:00:00.015 KEYWORD: BuiltIn.Fail the calculated near terms amount which was inserted in the trade ticked differ to the near terms amount from the execution dialog, True
Documentation:
Fails the test with the given message and optionally alters its tags.
Source code:
Calculate Terms Amount
[Documentation] Calculates the terms amount out of the given rate
[Arguments] ${givenAmount} ${givenRate}
log ${givenAmount}
${givenAmount}= Strip Numeric Commas ${givenAmount}
#log ${givenAmount}
${termsAmount}= Evaluate ${givenAmount} * ${givenRate}
${result}= Strip Numeric Commas ${termsAmount}
${result}= Convert To Number ${result} 5
[Return] ${result}
Код проверяет математику, выполненную тестируемой системой.Номер, указанный в заявке, верен, мой ответ не верен.