Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
656 B
Text
27 lines
656 B
Text
import Decimal from 'decimal.js';
|
|
import { ToPrimitive } from './262';
|
|
export function ToIntlMathematicalValue(input) {
|
|
var primValue = ToPrimitive(input, 'number');
|
|
if (typeof primValue === 'bigint') {
|
|
return new Decimal(primValue);
|
|
}
|
|
// IMPL
|
|
if (primValue === undefined) {
|
|
return new Decimal(NaN);
|
|
}
|
|
if (primValue === true) {
|
|
return new Decimal(1);
|
|
}
|
|
if (primValue === false) {
|
|
return new Decimal(0);
|
|
}
|
|
if (primValue === null) {
|
|
return new Decimal(0);
|
|
}
|
|
try {
|
|
return new Decimal(primValue);
|
|
}
|
|
catch (e) {
|
|
return new Decimal(NaN);
|
|
}
|
|
}
|