scala - How to print $ using String Interpolation -
this question has answer here:
i have started learning scala .i want print $ using string interpolation
def main(args:array[string]){ println("enter string") val inputstring:string=readline() val inputasdouble:double=inputstring.todouble printf(f" owe '${inputasdouble}%.1f3 ") }
input 2.7255 output .you owe 2.73 while want owe $2.73 pointers of great help
just double it
printf(f" owe $$${inputasdouble}%.1f3 ")
result:
16/06/02 10:16:04: owe $2,73