Loading ...
Sorry, an error occurred while loading the content.

Re: [libertybasic] ROUNDUP APOLOGY

Expand Messages
  • noelmartin
    ... From: noelmartin To: libertybasic@yahoogroups.com Sent: Sunday, November 04, 2001 9:17 AM Subject: Re: [libertybasic] ROUNDUP APOLOGY corrected code now
    Message 1 of 2 , Nov 4, 2001
    • 0 Attachment
      ----- Original Message -----
      Sent: Sunday, November 04, 2001 9:17 AM
      Subject: Re: [libertybasic] ROUNDUP APOLOGY

      corrected code now enclosed
       
          print  ' a blank line
       
          multiple = .65  ' round userValue to this nearest multiple
       
          maximumValue = 143934  ' the largest number that user can enter
       
        ' add one more unit if part of a multipleUnit is >= .5
          multipleUnitAdjustment = .5
       
          print " Rounding to nearest multiple of ";multiple
          print
       
          print " The maximum acceptable value is ";maximumValue
          print
       
          input " Enter your number to be rounded ";roundNumber$
       
        ' the value contained in the string called ' roundNumber$ '
          userValue = val( roundNumber$ )
          print
       
          if userValue > maximumValue then print "      Your number is TOO LARGE" : end
       
          multipleUnits = int(( userValue / multiple ) + multipleUnitAdjustment )
          roundedNumber = multipleUnits * multiple
       
          print " The newly rounded value is this ";roundedNumber
       
          end
       

       
    Your message has been successfully submitted and would be delivered to recipients shortly.