[jawsscripts] Re: decimal variable
- From: "Arya" <brk339999@xxxxxxxxx>
- To: <jawsscripts@xxxxxxxxxxxxx>
- Date: Thu, 9 Oct 2008 08:22:19 +0530
Hi Paul,
Thanks for the reply.
I will play with the code, and get back to you with the results.
With Regards.
In a day, when you don't come across any problems, -you can be sure that
you are travelling in the wrong path -. .
SWAMI - VIVEKANANDHA .
----- Original Message -----
From: "Paul Magill" <magills@xxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Wednesday, October 01, 2008 7:22 PM
Subject: [jawsscripts] Re: decimal variable
> Hi,
>
> The short answer is no.
>
> However, the standard work around is to multiply the value by say 100, do
> any calculations, then at the final display/speaking convert it back to
> decimals.
>
> The below example has not been compiled or tested. It is just to give the
> concept briefly.
> let iVariable1 = 150 ; 1.5 * 100
> let iVariable2 = 260 ; 2.6 * 100
> let IVariable3 = iVariable1 + iVariable2
> let iVariable4 = iVariable3 /3
>
> let ResultString1 = IntToString(iVariable3 / 100) + "." + IntToString
> (iVariable3 % 100)
> let ResultString2 = IntToString(iVariable4 / 100) + "." + IntToString
> (iVariable4 % 100)
>
> When the result strings are read or TypeStringed to screen, they should
> give
> the correct answers in standard decimal format.
>
> You can also pick up decimal values from the screen by manipulating the
> string read with GetWord or GetChunk, & converting it to an integer which
> is, say 100 times the value on the screen.
>
> the percent, is the modulas operator which gives the remainder left after
> dividing the iVariable by 100. ie. 10 for iVariable3
>
> Of course, if you were doing dollar & cent calculations, you may need to
> multiply by more than 100 in order to maintain accuracy in some
> calculations.
>
> Keep in mind though, that there is a upper limit to the value the integer
> variable can hold, 255 to the power of 4, and the amount you multiply by
> to
> maintain accuracy needs to be balanced by this limit.
>
> Hope this helps.
> Regards,
> Paul from Aust
>
> ----- Original Message -----
> From: "Arya" <brk339999@xxxxxxxxx>
> Hello Friends,
> Does Jaws accept decimals?, I mean is it possible to declare a
> variable, and assign decimal values 1.5 2.5 etc?.
> With Regards.
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
>
__________
Visit and contribute to The JAWS Script Repository http://jawsscripts.com
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
- References:
- [jawsscripts] Re: decimal variable
- From: Paul Magill
Other related posts:
- » [jawsscripts] Re: decimal variable
- » [jawsscripts] Re: decimal variable
- » [jawsscripts] decimal variable
- [jawsscripts] Re: decimal variable
- From: Paul Magill