如何解决如何将时间跨度乘以百分比
我正在尝试将TimeSpan与系数相乘,但是我不知道该怎么做。
我已经尝试过:
long ErrorCoef = 25;
TimeSpan TotalTimer = new TimeSpan(10,1,2,0);
TimeSpan TotalTimer2 = TimeSpan.FromTicks(TotalTimer.Ticks + TotalTimer.Ticks * (ErrorCoef / 100));
但是(ErrorCoef/100)
会自动转换为Long,因此它返回0。
(TimeSpan.FromTicks()方法仅接受Long而不接受Double)
解决方法
Timespan有一个Multiply方法,所以
.flex-rows {
display: flex;
flex-direction: column;
}
.flex {
display: flex;
}
.parent {
height: 250px;
width: 100%;
}
.child1,.child2,.child3 {
float: left;
display: inline-block;
height: 100%;
margin: 0px;
padding: 0px;
}
.child1 {
background-color: blue;
width: calc(100% - 253px);
}
.child1>*,.child1>*>* {
width: 100%;
display: block;
height: 100%;
}
.child2 {
background-color: green;
width: 100px;
}
.child3 {
background-color: red;
width: 150px;
}
.child1 textarea {
overflow-y: scroll;
}
应该可以解决问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。