Re: [Gambas-user] Best ways to format float values
I always round i.e. Print Round(26.66016,-2) --> which is 26.66 by the way, not 26.67! (I have no idea how you got that.) b On 13/07/17 15:09, alexchernoff wrote: Peace to all, this might a bit silly but what is the best way to format float values like 26.66016 into having two digits AND/OR with rounding them? e.g. 26.66016 becomes 26.66 shortened 26.66016 becomes 26.67 rounded cheers! -- View this message in context: http://gambas.8142.n7.nabble.com/Best-ways-to-format-float-values-tp59733.html Sent from the gambas-user mailing list archive at Nabble.com. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Mystery with file.load and regexp
On 05/07/17 11:58, Fernando Cabral wrote: I have found and worked around the problem. When you do the following: *Dim Expressions as string[] = Split(File.Load("/home/fernando/.config/libreoffice/4/user/basic/indesejaveis.txt"), "\n") * The last item pushed into *Expressions* is an empty string ("") even though it DOES NOT exist in the file. So, the expressions are compiled one after the other til the last one, that is empty. Then the program crashes. So it seems there is a bug in the *load.file()*. Bug that I was able to compensate for by adding the option *True* in the call to the functions *split()*. I think you might find that the last character of indesejaveis.txt is a \n (as is the case for many, many files) so in actual fact your original split did exactly what it was supposed to do. And your work around is correct. Although it is not actually a work around it is a very common construct when dealing with text files. So, I very much doubt there is a bug in File.Load() b -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] who to detect if are running inside IDE
On 04/07/17 08:12, Jussi Lahtinen wrote: I don't understand why you need stop menu to your project. Why can't you just use the stop button from the IDE? Jussi Coz it stops at a defined place, not just next time the eventloop runs. b -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] System.Language (gb)
On 04/07/17 07:13, Tobias Boege wrote: On Tue, 04 Jul 2017, bb wrote: >Static Property Language As String > >Returns or sets the current language setting. > >But which one? LANG? LC_ALL? LANGUAGE? ... > According to source code it returns: 1. LC_ALL if that's non-empty, next 2. LANG if that's non-empty, or otherwise 3. en_US. Regards, Tobi Thanks Tobi, ( I looked but couldn't find it in main ???) WIki updated. Any comment on the UTF-8 bit? b -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] System.Language (gb)
Static Property Language As String Returns or sets the current language setting. But which one? LANG? LC_ALL? LANGUAGE? ... My problem is that most of my ENV localisations are set to "en_AU.UTF-8", the UTF-8 bit is supposed to be ignored but it isn't somewhere and so the translation doesn't get done. b -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user