Rounded As String "Trick" but with an error!

Post » Mon Jul 06, 2015 2:57 pm

debug.messagebox(ArrowAccuracy * 100)

if Utility.IsInMenuMode()
Float Rounded = (((100 * ArrowAccuracy) * 100 + 0.5) / 100.0) As Int
String Out = StringUtil.SubString(Rounded As String, 0, StringUtil.Find(Rounded As String, ".", 0) + 3 )
debug.messagebox(out)
endif

So the above GREEN reports my test arrow as 85.23 but the RED reports it as only 85.00.

Obviously there is some rounding error in the math. Can anyone find it and offer a correction?

EDIT: NEVERMIND! It was simple, just remove the "as int" part. :facepalm:

User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Mon Jul 06, 2015 9:24 am

Closed at request.

User avatar
X(S.a.R.a.H)X
 
Posts: 3413
Joined: Tue Feb 20, 2007 2:38 pm


Return to V - Skyrim