[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Same code prints prices in 32nds and decimals?



PureBytes Links

Trading Reference Links

I'd like to ask for help.  I want to run the same system
on several commodities, and print out prices occasionally.
For those commodities that trade in points and 32'nds of
a point (such as T-Bonds and 10-Year-Notes), I'd like
the printout to say

    PRICE: 100-21

which means 100 and 21/32nd's, i.e. 100.656250 in decimal


But for those commodities that trade in points and
100ths of a point (such as Cotton and Heating Oil), I'd
like the printout to say

    PRICE: 18.32

which means 18 and 32/100ths, i.e. 18.32000 in decimal.


I can see how to do this THE BRUTE FORCE UGLY UGLY WAY,
namely, look at the commodity ID number, and based on
that ID, branch to one of several individual print
statements, each laboriously written by me, with one
print statement for decimals, one for 32nds, one for
32nds and quarters of 32nds (like 2-Year-Notes), etc.

But, I ask, is there a better way?  An easier way?
Dare I say when talking about Easy Language, a more _elegant_
way?

Thank you very much,
  -Mark Johnson
--
   Mark Johnson     Silicon Valley, California     mark@xxxxxxxxxxxx

   "... The world will little note, nor long remember, what is said
    here today..."   -Abraham Lincoln, "The Gettysburg Address"