PC Review


Reply
Thread Tools Rate Thread

how to calculate with commas (division)

 
 
Ragnar
Guest
Posts: n/a
 
      19th Jan 2005
I want to do divisions in a dos box getting results with
commas (or dots).

like: 7 / 2 = 3,5
or even 7,5 / 2 = 3,75
More than 2 numbers after the comma arent necessary

with "set /a ST=7/2" and "expr.exe 7 / 2" (from unix utils)
i always get it rounded to 3

Is there a way or a commandline tool where i can work with
commas as variables?

 
Reply With Quote
 
 
 
 
Matthias Tacke
Guest
Posts: n/a
 
      19th Jan 2005
Ragnar wrote:
> I want to do divisions in a dos box getting results with
> commas (or dots).
>
> like: 7 / 2 = 3,5
> or even 7,5 / 2 = 3,75
> More than 2 numbers after the comma arent necessary
>
> with "set /a ST=7/2" and "expr.exe 7 / 2" (from unix utils)
> i always get it rounded to 3
>
> Is there a way or a commandline tool where i can work with
> commas as variables?
>

Conset from Frank P. Westlake will do what you want.
http://gearbox.maem.umr.edu/fwu/

conset /?
Version 1.4, Copyright (C)2001, 2002, Frank P. Westlake.
Displays, sets, or deletes cmd.exe environment variables,
modifies console parameters, and performs floating point
mathematics.

HTH

--
Gruesse Greetings Saludos Saluti Salutations
Matthias
---------+---------+---------+---------+---------+---------+---------+
 
Reply With Quote
 
Michael Bednarek
Guest
Posts: n/a
 
      19th Jan 2005
On Wed, 19 Jan 2005 01:47:38 -0800, "Ragnar"
<(E-Mail Removed)> wrote in
microsoft.public.win2000.cmdprompt.admin:

>I want to do divisions in a dos box getting results with
>commas (or dots).
>
>like: 7 / 2 = 3,5
>or even 7,5 / 2 = 3,75
>More than 2 numbers after the comma arent necessary
>
>with "set /a ST=7/2" and "expr.exe 7 / 2" (from unix utils)
>i always get it rounded to 3
>
>Is there a way or a commandline tool where i can work with
>commas as variables?


Under 4NT the command "SET /A ST=7/2" shows the expected correct result.

AFAIK "SET /A" is not available under 4DOS, where JPSoft's native method
for calculations, the built-in function @EVAL, can be used. It sports a
pretty rich set of operations - see <http://jpsoft.com/help/f_eval.htm>.
4DOS is free, 4NT is not.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
 
Reply With Quote
 
Al Dunbar [MS-MVP]
Guest
Posts: n/a
 
      19th Jan 2005

"Ragnar" <(E-Mail Removed)> wrote in message
news:220001c4fe0b$e98af570$(E-Mail Removed)...
> I want to do divisions in a dos box getting results with
> commas (or dots).
>
> like: 7 / 2 = 3,5
> or even 7,5 / 2 = 3,75
> More than 2 numbers after the comma arent necessary
>
> with "set /a ST=7/2" and "expr.exe 7 / 2" (from unix utils)
> i always get it rounded to 3
>
> Is there a way or a commandline tool where i can work with
> commas as variables?


You don't want to calculate with commas, you want to be able to extend
integer math to include real numbers. Integer math is generally handled
quite adequately by the SET/A command (except that it chokes on numeric
values like 08 and 09), however, it has no knowledge whatsoever of real,
decimal, or fractional values.

I would recommend you consider doing what you want to do using WSH and
vbscript or jscript, both of which have the numerical capabilities you seek.

/Al


 
Reply With Quote
 
raster@highfiber.com
Guest
Posts: n/a
 
      20th Jan 2005
Michael Bednarek wrote:

> Under 4NT the command "SET /A ST=7/2" shows the expected correct

result.
>
> AFAIK "SET /A" is not available under 4DOS


It is, actually; it just isn't documented.
--
Charles Dye (E-Mail Removed)

 
Reply With Quote
 
Jean Pierre Daviau
Guest
Posts: n/a
 
      9th Feb 2005
http://www.cmdtools.com/files/eval.zip

There is others...

Jean

"Al Dunbar [MS-MVP]" <alan-no-drub-(E-Mail Removed)> a écrit dans le message
de news: O9flArk$(E-Mail Removed)...
>
> "Ragnar" <(E-Mail Removed)> wrote in message
> news:220001c4fe0b$e98af570$(E-Mail Removed)...
>> I want to do divisions in a dos box getting results with
>> commas (or dots).
>>
>> like: 7 / 2 = 3,5
>> or even 7,5 / 2 = 3,75
>> More than 2 numbers after the comma arent necessary
>>
>> with "set /a ST=7/2" and "expr.exe 7 / 2" (from unix utils)
>> i always get it rounded to 3
>>
>> Is there a way or a commandline tool where i can work with
>> commas as variables?

>
> You don't want to calculate with commas, you want to be able to extend
> integer math to include real numbers. Integer math is generally handled
> quite adequately by the SET/A command (except that it chokes on numeric
> values like 08 and 09), however, it has no knowledge whatsoever of real,
> decimal, or fractional values.
>
> I would recommend you consider doing what you want to do using WSH and
> vbscript or jscript, both of which have the numerical capabilities you
> seek.
>
> /Al
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
division in access to round-up if division not whole number ddiel Microsoft Access VBA Modules 10 30th Dec 2009 12:59 AM
If purchase ? days calculate what % ticket amt is of Division tot =?Utf-8?B?VC1iaXJk?= Microsoft Access Reports 0 6th Jul 2006 11:01 PM
is there a division symbol. As in a maths division symbol =?Utf-8?B?Q3VwQ2FrZQ==?= Microsoft Word Document Management 3 15th Nov 2005 12:38 AM
Passmark Performance Test, Division, Floating Point Division, 2DShapes @(none) Computer Hardware 0 19th Aug 2004 11:57 PM
Calculate division within Access table tallulah Microsoft Access 3 16th Jan 2004 12:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:08 PM.