Is it possible to round numbers within vim?

I use this command to find numbers in my text with decimals:

:%s/\(\d\{1,}\)\(\,\)\(\d\{1,}\)/   xxx   /g

I would like to replace "xxx" with

if decimal >= ,5  --> round up and remove decimals
p.e. 4,5 --> 5

if decimal < ,5 --> round down and remove decimals.
p.e. 4,4 --> 4

but I don't know how to insert this in above substitute command.
Can anyone help me?




-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to