ঘোষণা :
15 এপ্রিল, 2025 এর আগে আর্থ ইঞ্জিন ব্যবহার করার জন্য নিবন্ধিত সমস্ত অবাণিজ্যিক প্রকল্পগুলিকে অবশ্যই আর্থ ইঞ্জিন অ্যাক্সেস বজায় রাখার জন্য
অ-বাণিজ্যিক যোগ্যতা যাচাই করতে হবে।
ee.Number.format
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
printf-শৈলী বিন্যাস ব্যবহার করে একটি সংখ্যাকে একটি স্ট্রিংয়ে রূপান্তর করুন।
ব্যবহার | রিটার্নস | Number. format ( pattern ) | স্ট্রিং |
যুক্তি | টাইপ | বিস্তারিত | এই: number | সংখ্যা | একটি স্ট্রিং এ রূপান্তরিত সংখ্যা। |
pattern | স্ট্রিং, ডিফল্ট: "%s" | একটি printf-শৈলী বিন্যাস স্ট্রিং। উদাহরণস্বরূপ, '%.2f' '3.14'-এর মতো ফর্ম্যাট করা সংখ্যা তৈরি করে এবং '%05d' '00042'-এর মতো ফর্ম্যাট করা নম্বর তৈরি করে। বিন্যাস স্ট্রিং নিম্নলিখিত মানদণ্ড পূরণ করতে হবে:- শূন্য বা তার বেশি উপসর্গ অক্ষর।
- ঠিক এক '%'।
- সেটে শূন্য বা তার বেশি সংশোধক অক্ষর [#-+ 0,(.\d]।
- [sdoxXeEfgGaA] সেটে ঠিক একটি রূপান্তর অক্ষর।
- শূন্য বা তার বেশি প্রত্যয় অক্ষর।
ফরম্যাট স্ট্রিং সম্পর্কে আরও জানতে, https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html দেখুন |
উদাহরণ
কোড এডিটর (জাভাস্ক্রিপ্ট)
print('Zero-fill to length of 3',
ee.Number(1).format('%03d')); // 001
print('Include 1 decimal place in 1.2347',
ee.Number(1.23476).format('%.1f')); // 1.2
print('Include 3 decimal places in 1.2347',
ee.Number(1.23476).format('%.3f')); // 1.235 (rounds up)
print('Scientific notation with 3 decimal places shown',
ee.Number(123476).format('%.3e')); // 1.235e+05 (rounds up)
print('Integer with 2 decimal places of precision',
ee.Number(123476).format('%.2f')); // 123476.00
পাইথন সেটআপ
পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap
ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।
import ee
import geemap.core as geemap
Colab (পাইথন)
print('Zero-fill to length of 3:',
ee.Number(1).format('%03d').getInfo()) # 001
print('Include 1 decimal place in 1.2347:',
ee.Number(1.23476).format('%.1f').getInfo()) # 1.2
print('Include 3 decimal places in 1.2347:',
ee.Number(1.23476).format('%.3f').getInfo()) # 1.235 (rounds up)
print('Scientific notation with 3 decimal places shown:',
ee.Number(123476).format('%.3e').getInfo()) # 1.235e+05 (rounds up)
print('Integer with 2 decimal places of precision:',
ee.Number(123476).format('%.2f').getInfo()) # 123476.00
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003e\u003ccode\u003eNumber.format()\u003c/code\u003e converts Earth Engine Numbers to strings using printf-style formatting.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epattern\u003c/code\u003e argument accepts a format string, like '%.2f' for 2 decimal places or '%03d' for zero-padding to 3 digits.\u003c/p\u003e\n"],["\u003cp\u003eThis function allows customization of numeric output for display or further processing within Earth Engine scripts.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the Java Formatter documentation for details on available format string options and syntax.\u003c/p\u003e\n"]]],[],null,["# ee.Number.format\n\nConvert a number to a string using printf-style formatting.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------|---------|\n| Number.format`(`*pattern*`)` | String |\n\n| Argument | Type | Details |\n|----------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `number` | Number | The number to convert to a string. |\n| `pattern` | String, default: \"%s\" | A printf-style format string. For example, '%.2f' produces numbers formatted like '3.14', and '%05d' produces numbers formatted like '00042'. The format string must satisfy the following criteria: 1. Zero or more prefix characters. 2. Exactly one '%'. 3. Zero or more modifier characters in the set \\[#-+ 0,(.\\\\d\\]. 4. Exactly one conversion character in the set \\[sdoxXeEfgGaA\\]. 5. Zero or more suffix characters. For more about format strings, see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint('Zero-fill to length of 3',\n ee.Number(1).format('%03d')); // 001\n\nprint('Include 1 decimal place in 1.2347',\n ee.Number(1.23476).format('%.1f')); // 1.2\n\nprint('Include 3 decimal places in 1.2347',\n ee.Number(1.23476).format('%.3f')); // 1.235 (rounds up)\n\nprint('Scientific notation with 3 decimal places shown',\n ee.Number(123476).format('%.3e')); // 1.235e+05 (rounds up)\n\nprint('Integer with 2 decimal places of precision',\n ee.Number(123476).format('%.2f')); // 123476.00\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nprint('Zero-fill to length of 3:',\n ee.Number(1).format('%03d').getInfo()) # 001\n\nprint('Include 1 decimal place in 1.2347:',\n ee.Number(1.23476).format('%.1f').getInfo()) # 1.2\n\nprint('Include 3 decimal places in 1.2347:',\n ee.Number(1.23476).format('%.3f').getInfo()) # 1.235 (rounds up)\n\nprint('Scientific notation with 3 decimal places shown:',\n ee.Number(123476).format('%.3e').getInfo()) # 1.235e+05 (rounds up)\n\nprint('Integer with 2 decimal places of precision:',\n ee.Number(123476).format('%.2f').getInfo()) # 123476.00\n```"]]