By Alvin Alexander. Last updated: January 16, 2019
If you happen to be using Dotty (Scala 3) and find that the f
string interpolator isn’t working, it’s a known bug. (It was implemented with a macro, and the old, experimental macro system has been dropped.) I’m writing this in January, 2019; I don’t know when it will work again. You can use the Java/Scala String.format method until it’s fixed:
val pi = scala.math.Pi println( "%1.5f".format(pi) )