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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 201k
  • Answers 201k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's been some time, but I'm sure it's a backwards… May 12, 2026 at 8:15 pm
  • Editorial Team
    Editorial Team added an answer I can think of a number of approaches to your… May 12, 2026 at 8:15 pm
  • Editorial Team
    Editorial Team added an answer Would simply evaling the code be sufficient for your purposes?… May 12, 2026 at 8:15 pm

Related Questions

I can't figure out why I am getting this exception from my ant build.xml
I'm trying to compile a C++ project using Microsoft VisualStudio 2008. This particular project
Right now I am working on a stub of a project. In the course
I've recently been building a test framework for a bit of C# I've been
I'm having issues with a bit of code that I am writing in C#.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.