Menu

Decimal number check using JavaScript

While working with numbers specially decimal number or price or balance. A developer may face an issue where number is not coming in decimal format, and just appearing in round figure or only with one digit after decimal. like 12.2, 20, and 5.5

In this situation how to handle this on frond-end and show balance or price always in two decimal digits. Below is the code sample. 


if (cardBalanceData) {
	console.log('card balance '+cardBalanceData.balance);
	var gcBalance = cardBalanceData.balance;
	gcBalance = (gcBalance.toString().indexOf('.') >= 0) ? gcBalance : gcBalance+'.00';
	console.log("card balance in 2 decimal value:: "+ gcBalance);
}

Here in above JavaScript code, line #4 checking the gcBalance has decimal (.) into this, in case gcBalance doesn't have decimal value then append .00 into gcBalance otherwise print gcBalance as it is. 

First Human on the Earth and Adam | ChatGPT

We asked ChatGPT "who was the first human on the earth?" And this is what we have receive as answer.

The concept of a "first human" is a complex one, as the evolution of humans from earlier hominids is a gradual and ongoing process that occurred over millions of years. 

The earliest known members of the Homo genus (of which modern humans are a part) are believed to have emerged in Africa around 2.5-3 million years ago. However, these early humans were very different from modern humans, both physically and in terms of their behavior and cognitive abilities.

The species Homo sapiens (modern humans) is believed to have emerged in Africa around 300,000 years ago, and gradually spread throughout the world over the following tens of thousands of years. However, it's important to note that even among early Homo sapiens, there was likely significant genetic diversity and variation in appearance, behavior, and culture.

Therefore, it's not possible to point to a single "first human" who emerged at a specific time and place. Rather, human evolution is an ongoing process that has produced a wide range of human forms and cultures over time.

who was the first human on the earth?
Who was the first human on the earth?



Then, we asked follow-up question "doesnt Adam was the first man?" and got this response;

The idea of Adam as the first man comes from religious traditions, specifically from the Abrahamic religions of Judaism, Christianity, and Islam. According to these traditions, Adam was created directly by God and was the first human being on Earth.

However, from a scientific perspective, the concept of Adam as the first man is not supported by the evidence. Human evolution is an ongoing process that occurred over millions of years, and there was no single individual who can be identified as the "first man" in a scientific sense. Instead, the evolution of humans involved the gradual development and diversification of populations over time. Therefore, while the concept of Adam as the first man is meaningful in religious contexts, it is not a scientifically supported idea.

doesnt Adam was the first man?
Doesnt Adam was the first man?



IGNOU MAPY Assignment Paper July 2023

IGNOU Master of Philosophy (MAPY) second year assignment paper 2022-2023. 

Link to Download: MAPY assignment paper 


Comment with your email address to get the solved paper free of cost.