Created
          May 3, 2018 09:27 
        
      - 
      
- 
        Save hlassiege/8e547f939496dc973dbae11b84554f3f to your computer and use it in GitHub Desktop. 
    format.py
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import locale | |
| import datetime | |
| locale.setlocale( locale.LC_ALL, 'en_US' ) | |
| // va afficher : '$188518982.18' | |
| locale.currency( 188518982.18 ) | |
| // va afficher '1,255,000' | |
| locale.format("%d", 1255000, grouping=True) | |
| // va afficher '12/13/2011 12:00:00 AM' | |
| today=datetime.date.today() | |
| today.strftime('%c') | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment