본문 바로가기

■ Web개발/Ag-grid

ag-grid 에서 AgGridColumn에 반올림 값 적용시키기

valueFormatter: function (params) {return params.value.toFixed(2) ;}

이 식을 넣으면 됩니다.

 

cellStyle={{
                color: "rgb(180,120,255)",
                display: "flex",
                textAlign: "center",
                alignItems: "center",
                valueFormatter: function (params) {
                  return params.value.toFixed(2);
                },

어디에 넣냐면... cellstyle 안에 넣어도 작동이 되더군요

바깥에 적용시키려 한참 끙끙거리다가

안쪽에 넣으면 작동함을 발견.