Excel how to custom Number format 숫자 서식 사용자 지정 커스텀하기 / -0 을 0으로 바꾸기 음수
node.js + typescript + exceljs 로 엑셀 파일 생성을 하던 중, db에서 받은 데이터는 1000, 0, -500 이렇게 실수인 경우 모두 - 를 붙여서 출력해야 했다. numFmt : '#,##0' 은 123,400 이렇게 나오고 numFmt : '-#,##0' 은 -123,500 이렇게 나온다. 그래서 처음에는 '-#,##0'으로 사용했다. 그런데 내가 받은 데이터가 1000, 0, -500 이라면 '-#,##0'이 적용되어 나오는 형식이 아래 박스의 결과였다. The data I got from db was [100, 0, -500] and I had to show them in Excel file as negative. so first I tried exceljs numFmt..
[Javascript] 날짜 더하고 빼기 / How to set or add months, days, hours to Date / moment 라이브러리
1. new Date() function const today = new Date(); console.log(today); const ACertainDay = new Date('2020-01-01'); console.log('a certain day =', ACertainDay); const ACertainDay2 = new Date(2022, 1, 1,); console.log(ACertainDay2) console.log result new Date()은 () 안이 비어있으면 디폴트로 "현재"를 반환하고, 'YYYY-MM-DD' string형태로 값을 넣을 수 있다. 값을 넣는 형태는 (2020,1,1) 이렇게도 가능하다. It returns date, default is 'now' (when the..