How to conver this line of code from ace to MV (round)

so hi guys I'm converting again a script and I'm struggling HOW to conver a line...now it's not to know how to do some syntax from ace to MV but more... how to make this mathematical value :/


if @display_x != @t_display_x
if @display_x > @t_display_x
@display_x += [((@t_display_x - @display_x) / DIVIDER).round(4), -0.00001].min
elsif @display_x < @t_display_x
@display_x += [((@t_display_x - @display_x) / DIVIDER).round(4), 0.00001].max
end
@display_x = @display_x.round(4)
end


I just don't know how to properly doing the round equation :/...


thanks for you further answer //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif 
Code:
if (display_x != t_display_x) {
	if (display_x > t_display_x) {
		display_x += Math.min(Math.round((t_display_x - display_x) / DIVIDER) * 4, -0.00001);
	} else if (display_x < t_display_x) {
		display_x += Math.max(Math.round((t_display_x - display_x) / DIVIDER) * 4, 0.00001);
	}
	display_x = Math.round(display_x) * 4;
}
thanks //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif 

Original thread: https://forums.rpgmakerweb.com/threads/how-to-conver-this-line-of-code-from-ace-to-mv-round.58201/