如何找到下一组十个? [英] How to find the next set of ten of a number?

查看:85
本文介绍了如何找到下一组十个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。


假设我有一个数字55.下一个确切的十个将是60.如果

我的数字是72,那么下一个确切的然后将是80等等。

是否有任何功能可以找到给定的

数的下一组十个?我读过数学课,但似乎它没有这样的功能。


问候,

Robert Scheer

Hi.

Suppose I have a number 55. The next exact set of ten will be 60. If
my number is 72 the next exact set of then will be 80 and so on. Is
there any function that can find the next set of ten of a given
number? I read abou the Math class, but it seems that it doesn''t have
such a function.

Regards,
Robert Scheer

推荐答案

Robert Scheer写道:
Robert Scheer wrote:

嗨。


假设我有一个数字55.下一个确切的十个将是60.如果

我的数字是72,那么下一个确切的设置将是80,依此类推。

是否有任何功能可以找到给定的

数的下一组十个?我读过数学课,但似乎它没有这样的功能。


问候,

Robert Scheer
Hi.

Suppose I have a number 55. The next exact set of ten will be 60. If
my number is 72 the next exact set of then will be 80 and so on. Is
there any function that can find the next set of ten of a given
number? I read abou the Math class, but it seems that it doesn''t have
such a function.

Regards,
Robert Scheer



怎么样

y = Math.Ceiling(x / 10)* 10

How about
y = Math.Ceiling(x / 10) * 10


Robert Scheer写道:
Robert Scheer wrote:

嗨。


假设我有一个数字55.下一个确切的集合十个将是60.如果

我的数字是72,那么下一个确切的集合将是80,依此类推。

是否有任何功能可以找到给定的

数的下一组十个?我读过数学课,但似乎它没有这样的功能。


问候,

Robert Scheer
Hi.

Suppose I have a number 55. The next exact set of ten will be 60. If
my number is 72 the next exact set of then will be 80 and so on. Is
there any function that can find the next set of ten of a given
number? I read abou the Math class, but it seems that it doesn''t have
such a function.

Regards,
Robert Scheer



没有任何功能可以做到这一点但这样可行:


整数=整数= 55

昏暗的结果为整数=((数字+10)\ 10)* 10


希望这有帮助

LS

There is no function to do that but this will work:

Dim number as integer = 55
dim result as integer = ((number+10)\10)*10

Hope this helps
LS


7月26日下午2:04 * pm,Lloyd Sheen< a ... @ b.cwrote:
On Jul 26, 2:04*pm, Lloyd Sheen <a...@b.cwrote:

Robert Scheer写道:
Robert Scheer wrote:

嗨。
Hi.


假设我有一个数字55.下一个确切的十个将是60.如果

我的数字是72然后下一个确切的集合将是80,依此类推。

是否有任何功能可以找到给定的

数的下一组十个?我读过数学课,但似乎它没有这样的功能。
Suppose I have a number 55. The next exact set of ten will be 60. If
my number is 72 the next exact set of then will be 80 and so on. Is
there any function that can find the next set of ten of a given
number? I read abou the Math class, but it seems that it doesn''t have
such a function.


问候,

Robert Scheer
Regards,
Robert Scheer



有没有功能,但这将工作:


整数数字=整数= 55

dim结果为整数=((数字+10)\ 10 )* 10


希望这有帮助

LS


There is no function to do that but this will work:

Dim number as integer = 55
dim result as integer = ((number+10)\10)*10

Hope this helps
LS



这肯定会奏效,但我不能说我曾经喜欢\>

除以整数铸造。我发现很多

的程序员(尤其是初级级别的人)不知道这个功能

,这可能会导致一些非常困惑的维护程序员。对于

,我强烈建议您每当使用该功能时,都会发表评论以确保未来的开发人员知道发生了什么。


谢谢,


Seth Rowe [MVP]
http://sethrowe.blogspot.com/


这篇关于如何找到下一组十个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆