Support decimal data type in 4.*, and reduce logic complexity

Oh, sorry.