티스토리 뷰
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
- easy algorithm
- java
- HackerRank Algorithm
- 프로그래머스
- HashMap
- javascript
- hackerrank javascript
- math.max
- 알고리즘
- substring()
- hackerrank javascript solution
- C++
- hackerrank
- rest parameter
- math.abs
- hackerrank solution
- equals()
- Collection Framework
- ... in Javascript
- compareTo()
- Object type casting
- spring boot application
- 프로그래머스 알고리즘
- 프로그래머스 알고리즘문제
- repeat()
- easy javascript algorithm
- algorithm
- string class in java
- code refactoring
- Javascript Algorithm
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
글 보관함