Subject: | trailing zero behaviour of "numify" conflicts in various places. |
Some places seem to indicate numify will return a trailing-zero free result. But in practice, it returns with the number of zeros being a multiple of 3.
We're wanting the trailing-zero's, but are wary of relying on a feature that works, but is contrary to documented behaviour, as things that are contrary to documented behaviour are deemed "bugs".
http://search.cpan.org/dist/version/lib/version.pod#numify%28%29
: numify() Returns a value representing the object in a pure decimal form without trailing zeroes.
version->parse('1.2')->numify; # 1.2
http://search.cpan.org/~jpeacock/version-0.88/lib/version/Internals.pod
Numification:
For formatting purposes, when displaying a number which corresponds a version object, all sub versions are assumed to have three decimal places
http://cpansearch.perl.org/src/JPEACOCK/version-0.88/t/coretests.pm
# trailing zero testing (reported by Andreas Koenig). $version = $CLASS->$method("1"); ok($version->numify eq "1.000", "trailing zeros preserved"); $version = $CLASS->$method("1.0"); ok($version->numify eq "1.000", "trailing zeros preserved"); $version = $CLASS->$method("1.0.0"); ok($version->numify eq "1.000000", "trailing zeros preserved"); $version = $CLASS->$method("1.0.0.0"); ok($version->numify eq "1.000000000", "trailing zeros preserved"); # leading zero testing (reported by Andreas Koenig). $version = $CLASS->$method(".7"); ok($version->numify eq "0.700", "leading zero inferred"); # leading space testing (reported by Andreas Koenig). $version = $CLASS->$method(" 1.7"); ok($version->numify eq "1.700", "leading space ignored");