Re: Price Data Formatting



"Webbiz" <noreply@xxxxxxx> wrote in message news:%23Hj8CejAJHA.5316@xxxxxxxxxxxxxxxxxxxxxxx

Mike, When you load in a datafile of a stock or commodity,
you get data like this for example:
1.2324
1.2345
1.234
1.2876
1.2865
Now, when I said 'MOSTLY', is that if you look at this data,
note that MOST have 4 digits following the decimal point.
What if I only sampled one of these and it happened to be the
third one down on that list? I'd end up with a 'pattern' for all
my displayed data that was only 3 digits following the decimal
rather than 4. So a 'sampling' is needed to note that MOST
of the data use 4 digits following the decimal.
Make sense?

Nope. Doesn't make sense at all. I never suggested that you should sample only one data item. You've just made that up. I merely completely disagreed with your own hypothesis that you should check how many decimal digits MOST of the data items used. I suggested that instead of looking for the number of decimal digits that MOST of the data items use you should instead, with the specific "rider" I mentioned, look for the MAXIMUM number of decimal digits in the data list. For example, using your own suggestion of looking for the number of decimal digits used by MOST of the data items, and running it on the following list:

1.23
1.24
1.2345
1.2876
1.28

You would deduce that MOST of the data items had two decimal digits, and you would therefore according to your own hypothesis format ALL data items to two digits (according to your own rule). Do you REALLY want to drop the last two digits from those data items that actually contain four in the above list. Think about it.

Right now, without any formatting, I get values that look
like this after a calculation:
1.2837463839834874
1. It doesn't fit well in my textboxes for display.
2. It simply does not look like the prices loaded.

Of course you need to format the data items, and it of course makes sense and looks nice if you format them so that they all have the same number of decimal digits. I am not arguing with that. What I AM arguing with is your suggestion regarding how you should initially decide on how many decimal digits you need to display. Using the number of decimal digits found in MOST data items is not a good idea, as you should realise if you look again at my previous message and check again the contents of this message. You have asked for details of how to accomplish a specific task, but I think your hypothesis is wrong, and if you are doing the WRONG thing it doesn't matter how well you do it, it will still be wrong. Far better to do the RIGHT thing badly than to do the WRONG thing well ;-)

By the way, I asked three distinct questions in my previous messages and you have not answered a single one of them, apart from your accidental "half answer" above to the method you are using to display the output. Do you not actually read the responses you get? Do you just skip read them? Are you a bit too busy to read them properly?

Mike



.



Relevant Pages

  • RE: BoundField and DataFormatString in ASP.NET 2.0 - Bug ?
    ... I have turned one column display invisible but left its header visible. ... > formatted with the Euro sign and 2 decimal digits. ... > formatted like price 3 with Euro sign and with varying decimal digits. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Task Duration
    ... to input duration in minutes. ... but if you did it via an Excel spreadsheet, you can display any number ... of decimal digits you want. ... > entry to the nearest 15 minutes and simplify billing. ...
    (microsoft.public.project)
  • Re: Recursive Functions
    ... > result occupies over 6500 decimal digits, I won't display it here!) ... > seconds - almost five times slower. ...
    (comp.lang.c)
  • Re: maximum integer length?
    ... it is still trying to display the result) ... memory. ... I guess the best way would be a binary search for the proper value of ... He's talking about decimal digits. ...
    (comp.lang.python)