Issues
- Function round doesn't work correctlyLDEV-3158Michael Offner
- When using the MSSQL driver exceptions are ignoredLDEV-3127Resolved issue: LDEV-3127Pothys - MitrahSoft
- cfqueryparam sql type cf_sql_integer overflowLDEV-3118
- Reflected XSS via /rest/ endpointLDEV-3106Pothys - MitrahSoft
- continue does not work when using triple backticksLDEV-3006Michael Offner
- SameSite=None is missing from Set-Cookie HeadersLDEV-3000Resolved issue: LDEV-3000
- Make JkEnvVar variables available to CGI scopeLDEV-2986
- Redis Extension Cast ErrorLDEV-2983Pothys - MitrahSoft
- Administrator.updateDatasource() "verify" option fails when password is encryptedLDEV-2980Michael Offner
- Administrator.updateDatasource() issues creating MSSQL datasourceLDEV-2978Resolved issue: LDEV-2978Michael Offner
- arrayslice() negative offsets off by oneLDEV-2970Michael Offner
- Make cfhttp's timeout message more meaningful (connection timeout vs. page timeout)LDEV-2944
- query.columnList cannot be used with list or string member functionsLDEV-2924
- Non-Heap Memory Increases Till Server CrashesLDEV-2904Resolved issue: LDEV-2904Pothys - MitrahSoft
- CFFEED Issue getting attribute and node values from valid XML Feed.LDEV-2886Michael Offner
- Update MS-SQL Driver to version 8.2.2 which includes versions for jre11 and jre13LDEV-2879Michael Offner
- When there aren't any debugging logs, show debugging statusLDEV-2871Resolved issue: LDEV-2871Zac Spitzer
- Rounding in functions is different than ColdfusionLDEV-2863Resolved issue: LDEV-2863Michael Offner
- Trying to Connect to the DbServer using ConnectionStringLDEV-2848Michael Offner
- CFXML errorLDEV-2810Resolved issue: LDEV-2810Michael Offner
- Short-hand component properties parsed incorrectly - regression from 5.3.3LDEV-2748Resolved issue: LDEV-2748Michael Offner
- isNumeric doesn't support negative e notationLDEV-2747Resolved issue: LDEV-2747Michael Offner
- cfswitch tag not working the same as cfscript switchLDEV-2725Resolved issue: LDEV-2725Michael Offner
- Function isValid for URLs does not validate SharePoint/Office365 links properlyLDEV-2689Resolved issue: LDEV-2689Pothys - MitrahSoft
- Add function structValueArray()LDEV-2686Resolved issue: LDEV-2686Igal Sapir
- Function GeneratePBKDFKey() only handles algorithm PBKDF2WithHmacSHA1.LDEV-2682michael
- disabling and re-enabling debugging under debugging settings, doesn't preserve configurationLDEV-2680Resolved issue: LDEV-2680Pothys - MitrahSoft
27 of 27
Function round doesn't work correctly
Description
Environment
None
relates to
Details
Assignee
Michael OffnerMichael OffnerReporter
Rafael Rojas TorresRafael Rojas TorresPriority
NewLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Rafael Rojas Torres
Rafael Rojas TorresPriority
Labels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Created 24 November 2020 at 20:17
Updated 26 November 2020 at 14:39
Activity
Show:
Pothys - MitrahSoft26 November 2020 at 06:30
I've checked this ticket with 's PR in LDEV-2863. Yes, it works fine in Lucee and same as ACF.
KabutoTX25 November 2020 at 22:57
Yep. Both the OP’s and test work with my fix.
KabutoTX25 November 2020 at 22:35
This might fix it if it is ever approved. I will test.
[LDEV-2863] Rounding in functions is different than Coldfusion - Lucee (atlassian.net)
Pothys - MitrahSoft25 November 2020 at 15:26
I've checked this ticket and confirmed the issue happened on lucee latest version 6.0.0.13-SNAPSHOT also. While using a round function with precision returns a different result for some values.
In the function round the value doesn't work aproperty; for example we have 0.175 decimal, and the round() with 2 decimals return 0.17 we spected 0.18
examples:
round(0.175,2) eq 0.18
round(40954.465,2) eq 40954.47
round(32768.465,2) eq 32768.47
this one does correctly
round(32767.465,2) eq 32768.47
I made a custom round function.
<cffunction name="RoundUp" returntype="Any" access="public">
<cfargument name="Numero" type="numeric" default="0.0" required="true"/>
<cfargument name="decimales" type="numeric" default="2" required="false"/>
<cfset var valores=toString(Numero)>
<cfset valores=ListToArray(valores,'.')><!--- Separe integer value off decimal value --->
<cfset var Signo= 1><!--- Default sign positive --->
<cfif valores[1] neq 0><!--- integer is zero --->
<cfset Signo= abs(valores[1])/valores[1]><!--- Sign of value --->
</cfif>
<cfset var valorRedondear=valores[2]><!--- get decimal value--->
<cfset valores[2]=left(valores[2],max(0,decimales))><!--- Separe the decimal values to the length required--->
<cfif mid(valorRedondear,decimales+1,1) gt 4><!--- if the next position value is greather than 4 --->
<cfset valores[2]+=1><!--- we acumulate to the decimal --->
</cfif>
<cfset valores[2]=Signo*('0.'&valores[2])><!--- convert the decimal, in decimal part --->
<cfreturn valores[1]+valores[2]><!--- return the float value result --->
</cffunction>