일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- django
- Google Excel
- PANDAS
- Redshift
- Apache
- Excel
- string
- PostgreSQL
- Python
- Mac
- PySpark
- Github
- matplotlib
- Java
- Tkinter
- array
- math
- google apps script
- SQL
- list
- 파이썬
- c#
- hive
- Google Spreadsheet
- gas
- dataframe
- GIT
- numpy
- Kotlin
- Today
- Total
목록Round (3)
달나라 노트
C#에서 Math class는 다양한 수학적인 기능을 제공합니다. Math.Round는 소수점을 반올림한 값을 return해줍니다. Syntax Math.Round(number, digit) number를 digit에 명시된 소수점 자리까지 남긴 후 그 이하의 자릿수에서 반올림합니다. 예시는 다음과 같습니다. using System; class MyProgram { static void Main() { double value1 = 9.873; double result = Math.Round(value1, 1); Console.WriteLine(result); } } -- Result 9.9 Math.Ceiling은 소수점을 올림한 값을 return해줍니다. Syntax Math.Ceiling(number..
먼저 python의 numpy library에서는 반올림 함수로 round 가 있습니다. numpy.round(number, digit) number --> 반올림을 적용할 숫자입니다. digit --> 반올림 하여 얻은 결과에 소수점 자리수가 몇개나 있을지에 대한 숫자입니다. 이것의 의미는 아래 예시에서 보겠습니다. import numpy as np print(np.round(1738.7926)) # 1 --> 1739.0 print(np.round(1738.7926, 0)) # 2 --> 1739.0 print(np.round(1738.7926, 1)) # 3 --> 1739.8 print(np.round(1738.7926, 2)) # 4 --> 1739.79 print(np.round(1738.79..
먼저 python의 기본 반올림 함수로 round 가 있습니다. round(number, digit) number --> 반올림을 적용할 숫자입니다. digit --> 반올림 하여 얻은 결과에 소수점이 몇개나 있을지에 대한 숫자입니다. 이것의 의미는 아래 예시에서 보겠습니다. print(round(1738.7926)) # 1 --> 1739 print(round(1738.7926, 0)) # 2 --> 1739.0 print(round(1738.7926, 1)) # 3 --> 1739.8 print(round(1738.7926, 2)) # 4 --> 1739.79 print(round(1738.7926, 3)) # 5 --> 1739.793 print(round(1738.7926, -1)) # 6 -->..