#251 (website) format numbers properly on items.php


This patch formats numbers properly (human-readable) on items.php:
- 5.0E-4 will now be formatted as "0.0005";
- 1234556 will now be formatted as "1,234,556".

Two more very minor PHP isses were fixed:
- invalid index on $_REQUEST['name']
- double semicolon


  • Alexander Schuch

    format numbers properly

  • Katie Russell

    Katie Russell - 2009-05-04
    • assigned_to: nobody --> kymara
    • status: open --> closed-fixed
  • Katie Russell

    Katie Russell - 2009-05-04

    i applied your patch and it has fixed individual item pages, i.e. those using content/script/item.php (not items.php, which is content/game/items.php, i think you mistyped that above) so that clicking on say ugmash shows
    giant kobold
    Drops exactly 1.
    Probability: 0.0005%
    so that issue is fixed, thank you, but it seems only to work for item.php
    as the
    giant kobold creature page still shows
    Drops exactly 1.
    Probability: 5.0E-4%

    original report about it was
    https://sourceforge.net/tracker/?func=detail&aid=2550664&group_id=1111&atid=101111, he'd found the notation difficult to read when looking at what a creature drops, rather than from looking about a specific item

    it seems a shame not to be able to close that too when it's so close, shall i manually copy the format number methods over or do you want to look into it?

    btw if you are making patches that aren't to be applied from the root folder could you please add a note to let the developer patching know this and where it was meant to be applied. Thanks

  • Alexander Schuch

    The cleanest way is to put the method into an own file, or into a file containing other helper methods (common.inc.php or something), and then include the file (require_once) where ever needed.



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks