TJalam

Number Formatting Indian/USA

This is a Pine script that helps traders format numbers in different ways to make it easier to read and display big numbers on TradingView.

this script is specifically to help other fellow pinecoder. Its not a indicator.

The above code is an example of how to format numbers in TradingView using two different formats: Indian and USA. The code defines a function called `formatNumber()` which takes two arguments: num (the number to format) and format (the format to use - either "Indian" or "USA").

If the "Indian" format is selected, the function rounds the number to the nearest crore, lakh or thousand and adds the appropriate suffix (i.e. "Cr", "Lac" or "K"). If the "USA" format is selected, the function rounds the number to the nearest billion, million or thousand and adds the appropriate suffix (i.e. "B", "M" or "K").

In both cases, the function then adds commas to the formatted number. The example usage shows how to call the `formatNumber()` function with a given number and format, and then plot the formatted number as a label on the chart.



An enthusiast trader. I code my strategies in pine script.DM me for any Info.
Buy me coffee at:
paypal : tabrejalam786007@gmail.com
BTC : 15zY6PUsrV55UQvcfaSqk5hJexKZAwhpcK
TRC20: TPutH6FDYg6bJFF7xCjesp4n44qrMnizc7
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יכולים להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?