in reply to write off function using regex

Maybe something like
#!/usr/bin/perl use strict; use warnings; use POSIX; my @data = qw( 9.90 9.91 9.9111 9.94999 9.95 9.950001 9.96 9.99 9.9999 +9); foreach my $x (@data) { printf "%s => %.2f\n", $x, floor( 20*$x) /20, "\n"; }
which outputs

9.90 => 9.90
9.91 => 9.90
9.9111 => 9.90
9.94999 => 9.90
9.95 => 9.95
9.950001 => 9.95
9.96 => 9.95
9.99 => 9.95
9.99999 => 9.95

would fit too ?

Your wanted writeoff function is then simply floor( 20 * x) /20.