zsh-users
 help / color / mirror / code / Atom feed
From: Dan Nelson <dnelson@allantgroup.com>
To: "Brian K. White" <brian@aljex.com>
Cc: zsh-users@sunsite.dk
Subject: Re: math, percentage
Date: Sat, 31 Dec 2005 01:25:00 -0600	[thread overview]
Message-ID: <20051231072500.GJ39217@dan.emsphone.com> (raw)
In-Reply-To: <024d01c60dd7$576ed990$931fa8c0@venti>

In the last episode (Dec 31), Brian K. White said:
> is there a way to do this with built in math instead of running bc ?
> 
> tp=`echo "scale=0;(${t}*100)/$T" |bc`
> 
> T = some dynamic total number like `ls |wc -l`
> t = counter that starts at 1 and incriments as a loop walks through T
> tp = percent of total job completed so far

(( tp=t*100/T ))

-- 
	Dan Nelson
	dnelson@allantgroup.com


  parent reply	other threads:[~2005-12-31  7:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-31  6:56 Brian K. White
2005-12-31  7:22 ` Eric Mangold
2005-12-31  7:25 ` Dan Nelson [this message]
2005-12-31 20:44   ` Brian K. White
     [not found]     ` <488030720601041505g7a9aee72nc8ebcf1bde13b3a4@mail.gmail.com>
2006-01-05  4:43       ` Brian K. White
2006-01-05 23:54         ` Jonathan Hankins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051231072500.GJ39217@dan.emsphone.com \
    --to=dnelson@allantgroup.com \
    --cc=brian@aljex.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).