Comments (2)
Which locale are you speaking about?
from iless.
I don't know the specifics with the different locale variables but in some countries (for example SWEDEN locale sv_SE) numbers are formatted using a comma "," as decimal point instead of a point ".". Php uses those settings when converting numbers to strings which means that for example during
Iless_UnitConversion::setup() on UnitConversion.php:66 Iless_Math::divide gets called with '2' and M_PI, which then gets converted to string as M_PI => "3,141592....". bcmul in turn doesn't respect the locale when parsing that string and treats it as 0 resulting in a divide by zero error.
The locale can be manipulated by http://www.php.net/manual/en/function.setlocale.php
For example:
$saved_locale = setlocale('LC_ALL', 0);
setlocale('LC_ALL', 'C');
// Do math stuff
setlocale('LC_ALL', $saved_locale);
would solve the problem.
Another option would be to do the float to string conversion explicitly with
http://www.php.net/manual/en/function.number-format.php
number_format(M_PI, 10, '.'. '')
instead of through a cast.
from iless.
Related Issues (20)
- clean() dangerous
- Is there any test for 'no changes' to compilation? HOT 2
- Doesn't properly parse variables within an @import if not at begnning of string HOT 5
- Notice: Undefined property: ILess_Node_Quoted::$operator in ILess/Visitor/ProcessExtend.php on line 356
- setVariables doesn't handle rgba values right
- Issue #50 has resurfaced - Doesn't properly parse variables within an @import HOT 1
- tests bootstrap.php doesn't work as written HOT 1
- Errors prevent compilation of Twitter Bootstrap v3 w/ some Bootswatches
- Parser->toCSS() crashes on empty variable? HOT 3
- Cache does not work with source map output
- Allow parser setup from command line
- Cli utility does not exit with non zero error code
- Cache does not work under HHVM HOT 1
- parser fails with error code for long data uri HOT 1
- Import reference fails under php 7
- iless Strict Math option defult is different from less HOT 3
- detached rulesets aren't imported when using reference option HOT 1
- Simple CSS3 calc(100% - 10px) fails HOT 5
- How to prevent 0.5 from being changed to .5
- The long version of the strict-units option does not do anything.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iless.