Skip Menu |

This queue is for tickets about the Number-FormatEng CPAN distribution.

Report information
The Basics
Id: 123532
Status: resolved
Priority: 0/
Queue: Number-FormatEng

People
Owner: Nobody in particular
Requestors: bill_haller [...] autoelect.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Routine appears to kill intermediate zeroes in decimal
Date: Mon, 6 Nov 2017 11:41:36 -0700
To: bug-Number-FormatEng [...] rt.cpan.org
From: "William H. Haller" <bill_haller [...] autoelect.com>
Number::FormatEng::format_pref(2308) returns 2.38k
s/(?:(\.\d*[1-9])|\.)0+\z/$1/ (from perlmonks Aristotle) as trailing zero suppressor works, returning 2.308k.
--
William H. Haller, Linux Systems Manager
	External Mail, Web, Security

website:   http://autoelect.com

e-mail/IM: bill_haller@autoelect.com

phone:     307-234-9311
direct:    307-233-0336
fax:       307-234-9438

snail-mail:Automation Electronics
           Information Technology
           POB 2670
           Casper, WY 82602-2670

physical:  610 W Platte Road, Casper WY, 82602
Thank you for reporting this bug. I have uploaded a new version (0.03) which fixes this problem. I added your example to the tests. I also appreciate your effort in researching and identifying a solution. I read through the full PerlMonks thread, and I chose the simplest solution by ihb, which Aristotle even recommended. Here is the URL: http://www.perlmonks.org/?node_id=275219