Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 423065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:08:36+00:00 2026-05-12T19:08:36+00:00

Why? C:\path\>manage.py shell Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit

  • 0

Why?

C:\path\>manage.py shell
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.    

>>> import locale
>>> locale.getlocale()
('Spanish_Colombia', '1252')
>>> locale.currency( 1885, grouping=True )
'$ 1.885,00'
>>> locale.currency( -1885, grouping=True )
'($ 1.885,00)'

Can´t return $ -1.885,00?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:08:36+00:00Added an answer on May 12, 2026 at 7:08 pm

    Parentheses around a number to indicate it’s a debit (i.e. negative), not a credit (positive), are a common convention in accounting (I guess because the parentheses are more visible than a small minus/dash in front, and it’s crucial to distinguish debits from credits;-).

    So, it’s not surprising that many locales express that convention as the “proper way” to format negative numbers. If you want to use some parts of your locale’s conventions, such as the $ sign and the commas, but not others, such as the parentheses, you’ll have to use abs(yournumber) instead of just yournumber as the input to locale.currency, then, if yournumber < 0, do a little string manipulation to find the first digit and form a new string with the dash in front of it (or other string manipulations, depending on your desired way to express negative amounts — e.g. the sign “minus” [dash] could go before the currency symbol, or at the right of the whole string).

    Why do you think that whoever’s going to be reading that output wants some but not all of the locale’s conventions to apply to it, by the way?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I run python manage.py shell , I can print out the python path
From the Django shell (manage.py shell), when attempting to import a python module that
When I run python manage.py dbshell command I get this error: Error: You appear
Actually I have one website in c:/wamp/www path. But now I want to manage
I'm working on a piece of library code around IDisposable . The managed path
My path to a 'fulltime'- developer stated as a analyst using VBA with Excel,
A path in Perforce contains files a.txt and b.txt. I'll refer to the main
Given a path such as "mydir/myfile.txt" , how do I find the file's absolute
In ruby the library path is provided in $: , in perl it's in
How to get the path of the current csproject? Let's say I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.