Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 String threeDigits(int n) { | |
| 6 if (n >= 100) return "${n}"; | |
| 7 if (n > 10) return "0${n}"; | |
| 8 return "00${n}"; | |
| 9 } | |
| 10 | |
| 11 String twoDigits(int n) { | |
| 12 if (n >= 10) return "${n}"; | |
| 13 return "0${n}"; | |
| 14 } | |
| OLD | NEW |