Help on Round Off value - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Help on Round Off value (/Thread-Help-on-Round-Off-value) |
Help on Round Off value - AutomationTester2011 - 07-19-2011 I have a bill amount = 140 Round off value = -40 Net Amount = 100 if bill amount is 160 then round off value is 40 and then net amount is 200 can anyone help in preparing a formula to auto calculate the round off value and net amount based on given bill amount. Thanks in advance RE: Help on Round Off value - rajpes - 07-19-2011 Code: bill=140 RE: Help on Round Off value - tdevick - 07-19-2011 It looks like your rule is that your value is above n50, round up to the nearest 100, else round down to the nearest 100. For example, 140 rounds down to 100, 160 rounds up to 200. 240 rounds down to 200, 260 rounds up to 300. If that's true, you can do this: Code: Function RoundBill(billAmount) RE: Help on Round Off value - rajpes - 07-19-2011 Code: Function f(billAmount) |