fix: calculate max value before do convert data
fix: tabs to spaces