Table of Contents
Previous Sample | List of Samples | Next Sample

Postage.csh


#  Calculate U.S. first class postage required for a given weight in ounces.
#  Copyright (c) 1991-2003 by Hamilton Laboratories.  All rights reserved.

#  Reflects rate setting of June 30, 2002

proc postage(ounces)
   local cost
   #  Current rate is 37 cents for the first ounce + 23 cents for
   #  each additional ounce or fraction thereof.
   @ ounces = ceil(ounces)
   @ cost = .37 + (ounces - 1)*.23
   return printf('$%.2f', cost)
end

postage $argv



Previous Sample | List of Samples | Next Sample
Table of Contents



Copyright © 1988-2003 by Hamilton Laboratories. All rights reserved.