Q:

change the number of digits in a number within a string

I have a set of strings, which all have numbers with 4 digits, e.g.:
"FTMS + c NSI Full ms [364.0000-391.0000]"
I would like to convert all the numbers  to have only 2 digits, so that it becomes 
"FTMS + c NSI Full ms [364.00-391.00]"  
the strings do not have a specific structure. Is there a simple one line solution?

A:

gsubfn
This uses only a simple pattern that matches character strings representing a number having decimals converting each such match to numeric and using sprintf to format with 2 decimals.
library(gsubfn)

gsubfn("\\d+\\.\\d+", ~ sprintf("%.2f", as.numeric(x)), s)
## [1] "FTMS + c NSI Full ms [364.00-391.00]"

Base R
A base solution would be to match the part to be kept followed by the remaining digits and then keep only the part to be kept.
gsub("(\\d+\\.\\d{2})\\d+", "\\1", s)
## [1] "FTMS + c NSI Full ms [364.00-391.00]"

Note
The input is:
s <- "FTMS + c NSI Full ms [364.0000-391.0000]"

