Ruby - datavision formula script

I’m trying to set up a formula in datavision that just takes the value of
a field and divides it by 100. I’ve never used ruby before but have been
digging through the online docs for help, but I’m sitll not getting what
I need. I’ve tried many variations on the following:

{echo “{table.field / 100}”}

…but to no avail.

Can anyone point me in the right direction?

Thanks,

Jody

Jody Thigpen jthigpen@drsmedical.com writes:

I’m trying to set up a formula in datavision that just takes the value of
a field and divides it by 100. I’ve never used ruby before but have been
digging through the online docs for help, but I’m sitll not getting what
I need. I’ve tried many variations on the following:

{echo “{table.field / 100}”}

Use “{table.field} / 100” without the quotes. The text “{table.field}” is
replaced by the value of that field, then that number is divided by 100.
You don’t need to print or echo the result; the number is the result.

Jim

···


Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“If the Computer is a universal control system, let’s give kids universes
to control.” – Theodore H. Nelson (1974)

Thanks for the help. This is a great package you have here.

When I try:

{table.field} / 100

I get this error: java.util.EmptyStackException

and without the spaces (ie: {table.field}/100):

java.lang.UnsupportedOperationException: Operator “/100” is illegal

Am I doing this correctly?

Jody

···

On Mon, 10 Mar 2003 09:13:21 -0600, Jim Menard wrote:

Jody Thigpen jthigpen@drsmedical.com writes:

I’m trying to set up a formula in datavision that just takes the value
of a field and divides it by 100. I’ve never used ruby before but have
been digging through the online docs for help, but I’m sitll not
getting what I need. I’ve tried many variations on the following:

{echo “{table.field / 100}”}

Use “{table.field} / 100” without the quotes. The text “{table.field}”
is replaced by the value of that field, then that number is divided by
100. You don’t need to print or echo the result; the number is the
result.

Jim