https://kotlinlang.org logo
#language-evolution
Title
# language-evolution
s

stantronic

10/23/2023, 10:18 AM
Do you think it would be possible to add leading zeros to number literals in Kotlin? - e.g.
LocalTime.of(10,05)
reads a bit more naturally than
LocalTime.of(10,5)
j

Joffrey

10/23/2023, 10:19 AM
I don't think this is going to happen. Leading 0s will be confused with octal numbers by java devs
s

stantronic

10/23/2023, 10:20 AM
ah! hadn't thought of that. Thanks
j

Joffrey

10/23/2023, 10:20 AM
Also, in your example I guess a good way to make it look more natural is to use an actual format:
Copy code
LocalTime.parse("10:05")
LocalDate.parse("2023-10-23")
👍 1
s

stantronic

10/23/2023, 10:24 AM
yeah, good idea