Closed (fixed)
Project:
Format Number API
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2009 at 18:07 UTC
Updated:
2 Dec 2021 at 16:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Bevan commentedThe related patch for formatted_number module that uses the new function is at #580548: Additional formatters for fixed number of decimal places and significant figures.
Comment #2
Bevan commentedThe simpletest is a DrupalTestCase, but should really be a DrupalUnitTestCase. There is a bug in simpletest 2.9 that made that more problematic than it was worth though. That bug has now been fixed in Simpletest-dev and should be released in simpletest 2.10, whenever that comes out; #580406: DrupalUnitTestCase requires Database class
Comment #3
Bevan commentedThis is the simpletest DRUPAL-6--2 version of the test file that uses DrupalUnitTestCase.
Comment #4
markus_petrux commentedCould we add a link to a reference on how significant figures algorithm works? This would be fine as a note in the doxygen of the function itself. Then I will update the README and project page myself, but I would appreciate a link.
Comment #5
Bevan commentedAny suggestions on where to link to? I got the inspiration for the algo from here on php.net but it was broken and sub-optimal. I rewrote it myself. I contributed the corrected version back to php.net here, which is almost duplicate of what's in this patch.
Comment #6
markus_petrux commentedCommitted to CVS (commit). Thanks!
I have not committed the SimpleTest file. I'll add tests to the D7 branch, where the test framework is stable. For D6, it's been in flux, and I don't like the idea to keep supporting this yet.
Comment #7
Bevan commentedFair enough. Note that the signficant figures algo is sensitive so any changes should be tested with these simpletests, at the very least.
Comment #9
romano321 commentedThis is a calculator to use for this to check your code accuracy:
sig fig calculator
sig fig rules