UNPKG

@awsui/components-react

Version:

On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en

23 lines 712 B
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { formatDateTime } from '../internal/utils/date-time'; const KB = 1000; const MB = Math.pow(1000, 2); const GB = Math.pow(1000, 3); const TB = Math.pow(1000, 4); export function formatFileSize(size) { if (size < MB) { return `${(size / KB).toFixed(2)} KB`; } if (size < GB) { return `${(size / MB).toFixed(2)} MB`; } if (size < TB) { return `${(size / GB).toFixed(2)} GB`; } return `${(size / TB).toFixed(2)} TB`; } export function formatFileLastModified(date) { return formatDateTime(date); } //# sourceMappingURL=default-formatters.js.map