رقم JavaScript toExponential ()
مثال 1
تحويل رقم إلى تدوين أسي:
let num = 5.56789;
let n = num.toExponential();
التعريف والاستخدام
تقوم طريقة toExponential () بتحويل رقم إلى تدوين أسي.
مثال 2
let num = 5.56789;
let n = num.toExponential(3);
بناء الجملة
number.toExponential(x)
المعلمات
Parameter | Description |
---|---|
x | Optional. An integer between 0 and 20 representing the number of digits in the notation after the decimal point. If omitted, it is set to as many digits as necessary to represent the value |
قيمة الإرجاع
سلسلة ، تمثل الرقم كتدوين أسي. |
دعم المتصفح
Number.constructor
هي إحدى ميزات ECMAScript3 (ES3).
ES3 (JavaScript 1999) مدعوم بالكامل في جميع المتصفحات:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |