|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
truncating decimal on numbersI want 7 * .105263 to result in an int32 value of 0. and 7 * .189021 to
result in an int32 value of 1. I don't want to round. How can I just drop the decimal places? never mind--I knew as soon as I asked I'd find the answer. Sometimes
I'm tempted to ask just because I know I'll find the answer as soon as I hit send. Int or Fix is what I wanted. cj wrote: Show quoteHide quote > I want 7 * .105263 to result in an int32 value of 0. and 7 * .189021 to > result in an int32 value of 1. > > I don't want to round. How can I just drop the decimal places? "cj" <cj@nospam.nospam> schrieb: Check out 'Fix', 'Int', and 'Math.Floor' and 'Math.Ceil'.>I want 7 * .105263 to result in an int32 value of 0. and 7 * .189021 to > result in an int32 value of 1. > > I don't want to round. How can I just drop the decimal places? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> CJ,
You can always use it as string and than cut the decimals you don't want using the IProvider from ToSring. Is as well an easy way to round in any way you want. CJM Show quoteHide quote "cj" <cj@nospam.nospam> schreef in bericht news:O88JJn2AHHA.3396@TK2MSFTNGP02.phx.gbl... >I want 7 * .105263 to result in an int32 value of 0. and 7 * .189021 to >result in an int32 value of 1. > > I don't want to round. How can I just drop the decimal places?
Learning OOP conceptual question
What do you call nested If...Then search loops? SortedList - bug or undocumented behavior ? Idle time File Aging Program Iterating through a Hastable of objects Problem Adding and Using Resource Files convert idl to c# or tlb code collapsing in vb.net 2005 Find a control on a form of a specific name |
|||||||||||||||||||||||