import { formatNumber, formatNumberK, formatNumberW } from "./index";

test("base number format", () => {
  expect(formatNumber(1100)).toBe("1.1k");
});

test("format number to k", () => {
  expect(formatNumberK(1110)).toBe("1.11k");
  expect(formatNumberK(1100)).toBe("1.10k");
  expect(formatNumberK(110)).toBe(110);
});

test("format number to w", () => {
  expect(formatNumberW(11000)).toBe("1.1万");
  expect(formatNumberW(1100)).toBe(1100);
  expect(formatNumberW(100000)).toBe("10.0万");
});
