Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-17-2010, 03:29 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
This is known behavior, and I think intentional (would need to contact Stefan for reasoning). It shouldn't be hard to make your own float function which calls the internal float only in the case where all the characters of the string are integers (or decimal points). Not sure about scientific notation and how it handles that.
Reply With Quote
  #2  
Old 08-17-2010, 03:47 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by WhiteDragon View Post
This is known behavior, and I think intentional (would need to contact Stefan for reasoning). It shouldn't be hard to make your own float function which calls the internal float only in the case where all the characters of the string are integers (or decimal points). Not sure about scientific notation and how it handles that.
I'd rather have the default float() function work like the way it, at least in my opinion, is supposed to work.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 08-17-2010, 03:48 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by xXziroXx View Post
I'd rather have the default float() function work like the way it, at least in my opinion, is supposed to work.
It'd involve reworking literally all the string->number casting in GS which could introduce bugs. (Not saying that I disagree with your motive, it's just unrealistic.)
Reply With Quote
  #4  
Old 08-17-2010, 04:31 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by WhiteDragon View Post
which could introduce bugs.
More like fix current bugs and have it work like supposed too after that. Maybe Stefan could even write something up that'll only affect how float() handles things.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #5  
Old 08-17-2010, 04:36 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally Posted by WhiteDragon View Post
It'd involve reworking literally all the string->number casting
This is data conversion, not casting.
__________________
Kat
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.