티스토리 뷰
Simply use String.format(,) to format double output using BufferdWrite.
Example
output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file.getPath()), StandardCharsets.UTF_8));
output.write("Total Average: " + "\t" + "\t" + String.format("%.2f",average) + "%" + "\n" + "\n");
|
'JAVA' 카테고리의 다른 글
Singleton pattern (Java design pattern) (0) | 2019.07.10 |
---|---|
Scanner nextInt(), nextLine() (0) | 2019.07.10 |
File I/O - Decorator pattern, File.separator (0) | 2019.07.05 |
File I/O - loading data and creating txt file from CSV file. (0) | 2019.07.05 |
Convert Array to ArrayList, ArrayList to Set (0) | 2019.07.01 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- repeat()
- 알고리즘
- equals()
- C++
- Javascript Algorithm
- hackerrank solution
- math.abs
- Collection Framework
- compareTo()
- Object type casting
- HackerRank Algorithm
- javascript
- 프로그래머스 알고리즘
- hackerrank javascript
- hackerrank javascript solution
- hackerrank
- easy algorithm
- code refactoring
- java
- substring()
- rest parameter
- string class in java
- 프로그래머스
- 프로그래머스 알고리즘문제
- easy javascript algorithm
- ... in Javascript
- math.max
- algorithm
- HashMap
- spring boot application
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함