Menu

#3 negative number markup for readHTML

open
nobody
None
5
2006-02-14
2006-02-14
JT Moree
No

The readHTML could be improved by allowing it to add a
negative class to the span around each piece of data if
it really is negative. the option would specify which
columns to check. For each column it would add the
negative class if the number is negative.

If the column is not a number then what do we do?
Should we also add a positive class and what about a
zero class?

Discussion

  • JT Moree

    JT Moree - 2006-02-14

    Logged In: YES
    user_id=236631

    The format of the negative number might also be affected but
    that's more than just adding a class. The user can always
    use css and dhtml to change the numbers by selecting all
    spans having the negative class.

     
  • JT Moree

    JT Moree - 2006-02-14
    • summary: markup for readHTML --> negative number markup for readHTML
     
  • James A. Pattie

    James A. Pattie - 2006-03-09

    Logged In: YES
    user_id=27290

    Is the negative positive and zero classes something the user
    is allowed to specify to the readHTML method or are you
    wanting me to output:

    <span class="column_name negative">-1.50</span>
    <span class="column_name positive">1.50</span>
    <span class="column_name zero">0.00</span>

    where column_name is the result of running that columns name
    through the fixupAttributes() method provided by the
    DBIWrapper module.

     
  • JT Moree

    JT Moree - 2006-03-10

    Logged In: YES
    user_id=236631

    i would be happy if the data is just marked with something.
    Letting the user specify exact class names is not really
    important. the classes postivive, negative, zero are very
    meaningful.

     
  • James A. Pattie

    James A. Pattie - 2006-03-11

    Logged In: YES
    user_id=27290

    Do we want to call them sqlPositive, sqlNegative, sqlZero or
    some other prefix so that we don't potentially clobber a
    class that someone may have created for a totally different
    reason?

    Possibly numPositive, numNegative, numZero?

    I like the num version better since it is specifying that we
    are talking about numbers and not something else that may be
    positive or negative.

     
  • James A. Pattie

    James A. Pattie - 2006-03-11

    Logged In: YES
    user_id=27290

    Do we want to detect and differentiate between ints and floats?

     
  • JT Moree

    JT Moree - 2006-03-11

    Logged In: YES
    user_id=236631

    I think we are getting feature creep here. No I dont think
    it's neccessary to do any of these things. If we want to be
    safe we can allow the user to override the classNames but I
    dont think that is neccessary right now. I dont think the
    class names need to have num or sql appended but I'm not
    willing to fight about it. Just implement something.

     
  • JT Moree

    JT Moree - 2006-04-14

    Logged In: YES
    user_id=236631

    I realized today that I am formatting the output of my
    numbers to have commas etc. That might affect the perl code
    when doing comparisions for postive/negative etc. keep in
    mind when implementing this feature that commas may need to
    be stripped out and that in europe commas and decials are
    swapped.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.