You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2004/04/04 20:32:03 UTC
[Bug 3238] Score below 10 is not zero-padded causes bad sorting
http://bugzilla.spamassassin.org/show_bug.cgi?id=3238
------- Additional Comments From felicity@kluge.net 2004-04-04 11:32 -------
I was very positive we didn't do this, but sure enough in the 2.[56]x code:
if ($self->{conf}->{rewrite_subject}) {
my $subject = $self->{msg}->get_header("Subject") || '';
my $tag = $self->{conf}->{subject_tag};
$tag =~ s/_HITS_/sprintf("%05.2f", $self->{hits})/e;
$tag =~ s/_REQD_/sprintf("%05.2f", $self->{conf}->{required_hits})/e;
I'm not quite sure why we did it that way in 2.6x since we had the Tags code for
the other headers already... In 3.0, the Tags stuff is the way everything
works, including the Subject header. The new version is:
my $score = sprintf("%2.1f", $self->{score});
So #1: the 3.0 method is more correct, as it uses the same code everything else
does. #2: should we allow some method of passing in the printf format string,
or something similar? ie: _HITS(05.2f)_, or _HITS(1)_ (where 0 is 2.1, and 1
is 05.2)?
Thoughts?
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.