what do i use decimal or double variables?

تعرفه تبلیغات در سایت
عنوان عکس
عنوان عکس
عنوان عکس
عنوان عکس
عنوان عکس


یافته ها در جستجو

    امکانات وب

    آرشیو مطالب

    برچسب ها

    I have a question about decimals and doubles. I know that you cannot use any mathematical operands between decimals and doubles...but, for example I created a program for a store that is holding a sale and offering a 10% discount. I was told that for the most part you want to declare decimal variables when dealing with money but, would i be able to declare the 10% as a decimal? how would i? i did read about casting it from double to decimal but obviously there could be a loss of data.

    I have a second question, this is more of a curious question. I have purchased "starting out with visual C# 2012". and there is a question (3.42, for those who have the book) that asks "write a programming statement that declares a named constant for a 10 percent discount" and the answer is "const double discount = 0.9;" now i know it just says to write a statement so it could include more mathematical operations but, is there a format string that rounds this up to 10%?

    نویسنده : استخدام کار بازدید : 0 تاريخ : پنجشنبه 21 دی 1396 ساعت: 13:58
    برچسب‌ها :
    اخبار و رسانه هاهنر و ادبیاترایانه و اینترنتعلم و فن آوریتجارت و اقتصاداندیشه و مذهبفوتو بلاگوبلاگ و وبلاگ نویسیفرهنگ و تاریخجامعه و سیاستورزشسرگرمی و طنزشخصیخانواده و زندگیسفر و توریسمفارسی زبان در دیگر کشورهاads-123