List Icon
Archiv Mailingliste

2019 bis Juli 2022  2018  | 2017 2016 2015 | 2014 | 2013

Die Mailingliste ist seit Juli 2022 geschlossen, dient aber weiterhin als Informationsarchiv zu QF-Test.
Wenn Sie über Neuerungen zu QF-Test informiert bleiben wollen, können Sie einfach unseren Newsletter abonnieren:
Newsletter abonnieren


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] Generate random decimal number


  • Subject: Re: [QF-Test] Generate random decimal number
  • From: GAUTHIER Denis <Denis.Gauthier@?.au>
  • Date: Thu, 30 Jul 2015 16:32:38 +1000

Hi Fernanda,

 

QFTest provides some procedure to generate random data, but none generate floats.

 

The easiest way is to create your own Server script.

In Python for instance, the module you are after is random.

This simple call: random.uniform(1, 100) should return what you want.
 

The trick would be to limit the number of decimal (if this is what you want).

 

One proposition of script would be:

 

import random

 

low = rc.getNum(“low”)

high = rc.getNum(“high”)

precision = rc.getRum(“precision”)

 

value = random.uniform(low,high)

result = ‘{0:.{p}f}’.format(value, p=precision)

 

rc.setLocal(“number”, result)

 

 

Cheers,

Denis GAUTHIER

From: qftest-list-bounces@?.de [mailto:qftest-list-bounces@xxxxxx] On Behalf Of Fernanda Batista de Oliveira
Sent: Wednesday, 29 July 2015 3:37 AM
To: qftest-list@?.de
Subject: [QF-Test] Generate random decimal number

 

Hi, Im from Matera Systems at Brazil and we use QF-Test.

 

We would like to know if is possible generate random decimal numbers, for example 45,67.

 

There is some procedure in QF-Test to get this type of data? Or is it possible with jython code?

 

Thank you.

 

--

Att,

Fernanda Oliveira.

 

+55 19 3794 7255

This message contains OPEN information that is not sensitive and can be freely accessed by people both inside and outside of the Thales Group

This email was classified byGAUTHIER Denis on Thursday, 30 July 2015 4:32:38 PM

------------------------------------------------------------------------- DISCLAIMER: This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. -------------------------------------------------------------------------