... From: noelmartin To: email@example.com Sent: Sunday, November 04, 2001 9:17 AM Subject: Re: [libertybasic] ROUNDUP APOLOGY corrected code nowMessage 1 of 2 , Nov 4, 2001View Source----- 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