Re: [libertybasic] ROUNDUP APOLOGY
- ----- Original Message -----From: noelmartinSent: Sunday, November 04, 2001 9:17 AMSubject: Re: [libertybasic] ROUNDUP APOLOGYcorrected code now enclosedprint ' a blank linemultiple = .65 ' round userValue to this nearest multiplemaximumValue = 143934 ' the largest number that user can enter' add one more unit if part of a multipleUnit is >= .5
multipleUnitAdjustment = .5print " Rounding to nearest multiple of ";multiple
printprint " The maximum acceptable value is ";maximumValue
printinput " Enter your number to be rounded ";roundNumber$' the value contained in the string called ' roundNumber$ '
userValue = val( roundNumber$ )
printif userValue > maximumValue then print " Your number is TOO LARGE" : endmultipleUnits = int(( userValue / multiple ) + multipleUnitAdjustment )
roundedNumber = multipleUnits * multipleprint " The newly rounded value is this ";roundedNumberend