需要帮助。我正在制作电子账单系统,我遇到了一个问题,我解决了2个数字,最大值为99999,之后它将返回到00000。我将举个例子:
1st reading ==== 00050
2nd reading ==== 00100
3rd reading ==== 01000
4th reading ==== 10000
nth reading ==== 99950
last reading ==== 00050如何解决第n次和最后一次读取?答案必须是100...我使用的是php代码
发布于 2013-01-08 05:29:48
如果不看你的代码,很难确切知道你需要什么,但像这样的东西将是一般的方法:
// Assume you have $previous and $current
$difference = $current - $previous;
if ($difference < 0) {
$difference = $current + (99999 - $previous);
}https://stackoverflow.com/questions/14204250
复制相似问题