Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Decimal時間間隔の端数を表す値があります。
Decimal
この値を に合計する必要がTimeSpanありますが、効果的な方法が見つかりません。
TimeSpan
私の解決策は、今のところ、次のようにすることです。
myTimeSpan + new TimeSpan(0, 0, Math.Abs(decimalHours * 3600))
私の問題を解決するためのより良い方法はありますか?
どうですか
myTimeSPan + TimeSpan.FromHours((double)decimalHours);