Skip Menu |

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

Report information
The Basics
Id: 73717
Status: open
Priority: 0/
Queue: Number-Format

People
Owner: WRW [...] cpan.org
Requestors: milanm [...] portfolioaid.com
Cc:
AdminCc:

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



Subject: Overriding variables in non-OO approach
Date: Tue, 3 Jan 2012 17:43:19 -0500
To: <bug-Number-Format [...] rt.cpan.org>
From: "Milan Milicic" <milanm [...] portfolioaid.com>
Hello, I want to use Number::Format in non-OO manner (legacy code). I export :vars, override $NEG_FORMAT and a few other variables and then call "format_number" method. It disregards any of my variable overrides and goes on with default values instead. Here is the script: Show quoted text
--- START --- #!/usr/bin/perl use Number::Format qw(:vars :subs); # print out defaults print "\n------------------------------------\n"; print " THOUSANDS_SEP = $THOUSANDS_SEP \n"; print " DECIMAL_POINT = $DECIMAL_POINT \n"; print " MON_THOUSANDS_SEP = $MON_THOUSANDS_SEP \n"; print " MON_DECIMAL_POINT = $MON_DECIMAL_POINT \n"; print " INT_CURR_SYMBOL = $INT_CURR_SYMBOL \n"; print " DECIMAL_DIGITS = $DECIMAL_DIGITS \n"; print " DECIMAL_FILL = $DECIMAL_FILL \n"; print " NEG_FORMAT = $NEG_FORMAT \n"; print " KILO_SUFFIX = $KILO_SUFFIX \n"; print " MEGA_SUFFIX = $MEGA_SUFFIX \n"; print " GIGA_SUFFIX = $GIGA_SUFFIX \n"; print " KIBI_SUFFIX = $KIBI_SUFFIX \n"; print " MEBI_SUFFIX = $MEBI_SUFFIX \n"; print " GIBI_SUFFIX = $GIBI_SUFFIX \n"; print "------------------------------------\n\n"; # override a few variables $THOUSANDS_SEP = '.'; $NEG_FORMAT = '<<x>>'; $DECIMAL_DIGITS = 1; my $number = -2000.00; # Expected: <<2000.0>> # Received: -2,000.00 print "number displays as: " . format_number($number, 2, 1) . "\n\n"; --- END --- And here is the output on my system: ------------------------------------ THOUSANDS_SEP = , DECIMAL_POINT = . MON_THOUSANDS_SEP = , MON_DECIMAL_POINT = . INT_CURR_SYMBOL = USD DECIMAL_DIGITS = 2 DECIMAL_FILL = 0 NEG_FORMAT = -x KILO_SUFFIX = K MEGA_SUFFIX = M GIGA_SUFFIX = G KIBI_SUFFIX = KiB MEBI_SUFFIX = MiB GIBI_SUFFIX = GiB ------------------------------------ number displays as: -2,000.00 Any help appreciated. Cheers, - M CONFIDENTIALITY WARNING: This message is intended only for the use of the individual or entity to which it is addressed, and may contain information which is privileged, confidential, proprietary or exempt from disclosure under applicable law. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying or in any way using this message or its attachments. If you have received this communication in error, please notify the sender, and destroy and delete any copies you may have received.  
Subject: [rt.cpan.org #73717]
Date: Tue, 10 Jan 2012 15:43:10 -0500
To: <bug-Number-Format [...] rt.cpan.org>
From: "Milan Milicic" <milanm [...] portfolioaid.com>
Hello, is there please any update on this? Cheers, - M
No update. I saw the bug report but haven't worked on this module in a while.
Subject: RE: [rt.cpan.org #73717] Overriding variables in non-OO approach
Date: Tue, 10 Jan 2012 15:52:34 -0500
To: <bug-Number-Format [...] rt.cpan.org>
From: "Milan Milicic" <milanm [...] portfolioaid.com>
Thank you. Show quoted text
-----Original Message----- From: William_R_Ward via RT [mailto:bug-Number-Format@rt.cpan.org] Sent: January 10, 2012 3:50 PM To: Milan Milicic Subject: [rt.cpan.org #73717] Overriding variables in non-OO approach <URL: https://rt.cpan.org/Ticket/Display.html?id=73717 > No update. I saw the bug report but haven't worked on this module in a while.
Subject: RE: [rt.cpan.org #73717] Overriding variables in non-OO approach
Date: Tue, 10 Jan 2012 17:05:28 -0500
To: <bug-Number-Format [...] rt.cpan.org>
From: "Milan Milicic" <milanm [...] portfolioaid.com>
If it helps, on this particular server, we've downgraded to an ancient Number::Format module (found on a legacy server) and this seems to have resolved the issue. Show quoted text
-----Original Message----- From: Milan Milicic Sent: January 10, 2012 3:53 PM To: 'bug-Number-Format@rt.cpan.org' Subject: RE: [rt.cpan.org #73717] Overriding variables in non-OO approach Thank you.
-----Original Message----- From: William_R_Ward via RT [mailto:bug-Number-Format@rt.cpan.org] Sent: January 10, 2012 3:50 PM To: Milan Milicic Subject: [rt.cpan.org #73717] Overriding variables in non-OO approach <URL: https://rt.cpan.org/Ticket/Display.html?id=73717 > No update. I saw the bug report but haven't worked on this module in a while.