편집 기록

편집 기록
  • 프로필 허대영(소프트웨어융합대학)님의 편집
    날짜2016.09.24

    파이썬 1000단위 콤마 넣는법


    구글링을 해보니 1000단위마다 콤마를 넣으려고 할 때

    number =  12345
    
    number =  format(number, ',')
    

    이것과

    import locale
    
    locale.setlocale(locale.LC_ALL, '') 
    
    n = -1234567890.123
    
    s = locale.format('%.3f', n, 1)
    

    이런 방법이 있던데 차이점이 무엇인가요??

  • 프로필 알 수 없는 사용자님의 편집
    날짜2016.09.24

    파이썬 1000단위 콤마 넣는법


    구글링을 해보니 1000단위마다 콤마를 넣으려고 할 때

    number = 12345

    number = format(number, ',')

    이것과

    import locale

    locale.setlocale(locale.LC_ALL, '')

    n = -1234567890.123

    s = locale.format('%.3f', n, 1)

    이런 방법이 있던데 차이점이 무엇인가요??