Improving round(x) function for rounding of decimals to a given number n

I tried to use the function round(x,n) to round off a decimal digit to n decimal places. But this function does not work like matlab. If this function is not available in Octave, I like to contribute to improve this function.
Thank you.
Harish.

The change in behavior occurred in 2014. There are a couple existing bug reports, see:
https://savannah.gnu.org/bugs/?55682
and
https://savannah.gnu.org/bugs/?59642