Middle three digits: Difference between revisions
Content deleted Content added
Keithpinson (talk | contribs) |
→{{header|Scala}}: what the heck was that 'f"${v}%03d"' thing? |
||
Line 735: | Line 735: | ||
intVals map (middleThree(_)) map { |
intVals map (middleThree(_)) map { |
||
case None => "No middle three" |
case None => "No middle three" |
||
case Some(v) => |
case Some(v) => "%03d".format(v) // Format the value, force leading zeroes |
||
} mkString("\n") |
} mkString("\n") |
||
</lang> |
</lang> |