home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / hcshdemo.zip / csh-os2.zip / SAMPLES / POSTAGE.CSH < prev    next >
Text File  |  1993-09-28  |  412b  |  15 lines

  1. #    Calculate U.S. first class postage required for a given weight in ounces.
  2. #    Copyright (c) 1991 by Hamilton Laboratories.  All rights reserved.
  3.  
  4. proc postage(ounces)
  5.     local cost
  6.     #  Current rate is 29 cents for the first ounce + 23 cents for each
  7.     #        additional ounce or fraction thereof.
  8.     @ ounces = ceil(ounces)
  9.     @ cost = .29 + .23*(ounces - 1)
  10.     return printf('$%.2f', cost)
  11. end
  12.  
  13. postage $argv
  14.  
  15.