in reply to write off function using regex
Some solutions:
s/\.[0-9]\K(?:[0-4]|([5-9]))/$1?5:0/e [download]
s{\.[0-9]\K([0-9])}{int($1/5)*5}e; [download]
s{(.*)}{sprintf("%.2f", int($1*20)/20)}e; [download]
$_ = sprintf("%.2f", int($_*20)/20) . /(?!)/; # oblig regex [download]