Title: Re: Witango-Talk: Whole Number Check
AHHHHHHH....     Modulo

Thanks a bunch.

I will try it....

You can check it via JavaScript on the same page !
 
Just tell Java what the "Magic" number is (ie 10), then make a Java "modulo" function.
Is the result is 0, so you get it. If not, so send a Java Alert...
 
If you like to send the user on a another page, so you can also use the calc function.
 
%
Modulo. Returns the remainder of expr1 divided by expr2.
expr1 % expr2
 
<@ASSIGN NAME="Entered_Value" VALUE="<@ARG Fieldentry" SCOPE="User">
<@IF EXPR="<@CALC EXPR='@@USER$Entered_Value % @@User$Magic_Number'> = 0">
        The entry @@USER$Entered_Value is OK
    <@ELSE>
        The entry @@USER$Entered_Value is not OK
</@IF>
Hope it helps
 
regards
 
Daniel
 
----- Original Message -----
From: Web Dude
To: Multiple recipients of list witango-talk
Sent: Monday, May 06, 2002 7:07 PM
Subject: Witango-Talk: Whole Number Check

Tango 3.6 (old I know, but already started this on the server that
has this version)

I have a client that has thrown me a curve ball. The price table they
gave me has the unit prices of the products, but unkown to me until
today, all the products can only be ordered in various increments. So
the price table would show .94 per unit but the unit can only be
ordered in quantities of 10.

I decided to add the increment value to the product table.  The magic
number for the above example would be 10.

I'll try to keep this short.

If I take the magic number of the product and divide by the filled in
quantity of the clients post, and it evaluates to a whole number, we
are good to go, if not, go to a page that tells the client they must
order in quantities of 10.

Is there a way to check by calc or another method to see if the
evaluation has a decimal or fraction?

Does this make sense???

Thanks!


--
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body


-- 


Reply via email to