import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { useConfiguration } from '../../hooks';
import NoValue from '../NoValue/NoValue';
import { getFraction, getFormattedValue } from './utils';
export default forwardRef(function NumberDisplay({ value, unit = '', formattingOptions: { fractionDigits = getFraction(String(value)).substring(1).length, notation, groupSeparators = true } = {}, ...restProps }, ref) {
    const { locale } = useConfiguration();
    return (_jsx("span", { ref: ref, ...restProps, children: value || value === 0 ? (getFormattedValue(value.toString(), locale, unit, {
            notation,
            useGrouping: groupSeparators,
            maximumFractionDigits: fractionDigits,
            minimumFractionDigits: fractionDigits
        })) : (_jsx(NoValue, {})) }));
});
//# sourceMappingURL=NumberDisplay.js.map