We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If we use round function only, it will round the value upto 4 places after decimal as well as for rest values it will give 0.
for eg- round(1.166784)=1.166800
but we need to remove extra 0's from above that's why we cast it to decimal(10,4), which will get the 4 digits after decimal and Maximum 10 digits in total.
you can change it any as per the need but this is commonly used.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 13
You are viewing a single comment's thread. Return to all comments →
If we use round function only, it will round the value upto 4 places after decimal as well as for rest values it will give 0. for eg- round(1.166784)=1.166800 but we need to remove extra 0's from above that's why we cast it to decimal(10,4), which will get the 4 digits after decimal and Maximum 10 digits in total. you can change it any as per the need but this is commonly used.