Commit Graph
25 Commits
Author SHA1 Message Date
daboe01andMartin Carlberg 7bd8bf02f6 Fixed: Typo in function call to _CPDecimalSetZero and made the test case work properly (#2820) 2019-06-13 16:09:17 +02:00
Maik Opitz fb43f8bf1a Regex nochmals angepasst 2016-11-02 16:45:01 +01:00
Maik Opitz bf082600c3 fixed RegEx with newer gcc versions 2016-11-01 15:46:40 +01:00
Antoine Mercadal f9275a70af FIXED: New warnings reveleaded by ivar type checking
This patch fixes all new warnings
2014-11-06 10:17:05 -08:00
Andrew Hankinson 7bef84e4e9 Allow CPDecimal to handle decimal numbers with leading zeros
Without this fix, CPDecimal will return NaN for numbers that have leading zeros, e.g., 0123.

This fix changes the matching regex to allow leading zeros to pass. This is then converted to a proper number later on, e.g., "0123" => 123. This is in line with Cocoa behaviour.

This commit also includes updated unit tests.
2013-03-07 00:26:02 -05:00
Aparajita Fishman 63ae5848f6 Formatting, fixes for CPDecimal/CPDecimalNumber
- CPDecimalRound should return a result in all cases
- Fixed test of CPDecimalRound with CPDecimalNoScale
2013-02-11 14:05:52 -05:00
Stephen Ierodiaconou e17253d592 Fixes for #1720: CPDecimalCompare problems when comparing to zero. 2013-01-30 13:03:43 +02:00
Eric Wong def8016f44 code style change 2012-08-05 09:35:44 +08:00
Eric Wong 175c70d99e fix a new bug in CPDecimalMakeWithString and remove some test cases 2012-08-05 08:37:44 +08:00
Eric Wong 9f1a8fa7a2 enable '.003' or '-.003' style number in CPDecimalMakeWithString function and add new test cases 2012-08-04 23:04:40 +08:00
Alexander Ljungberg aa4eff9f8d Format code, fix accidental global. 2012-05-25 00:04:46 +01:00
Alexander Ljungberg 8aaf298466 Fixes #1529. Fixed: Incorrect CPDecimalNumber result for 220000/220.
And in general divisions where the quotient had fewer digits than the dividend when disregarding exponent would fail.

We want to stop dividing when we've gone over all the digits in the dividend and the remainder is 0.
2012-05-10 00:16:56 +01:00
Stephen Ierodiaconou b05d0dd1ec Fix for comparing decimal numbers < 1.0 with 0.0 2011-10-01 10:50:23 +01:00
Alexander Ljungberg 445adcb47f CPNumberFormatter rounding mode support. 2011-06-10 11:41:23 -07:00
Stephen Ierodiaconou 6a942630e4 Fixing spelling mistakes 2011-01-24 11:05:48 +02:00
Stephen Ierodiaconou c65bfd22a2 Use native javascript array for mantissa for big performance increase 2011-01-16 01:47:14 +02:00
Stephen Ierodiaconou 2fe8845842 CPDecimalString returns NaN for a NaN and Fix Compare of NaNs and Cocoa compatable handling of overflow/underflows when no exception 2011-01-15 19:29:55 +02:00
Stephen Ierodiaconou fc746db70f Cocoa compatible constructors for CPDecimals 2011-01-15 16:12:06 +02:00
Stephen Ierodiaconou 5a0cfc1595 Make default number hanler file global only and Improvements and optimisations for CPDecimalNumber 2011-01-15 11:49:20 +02:00
Klaas Pieter Annema a51672cc82 use charAt in CPDecimal, IE doesn't support [] 2010-11-30 16:05:32 +01:00
Alexander Ljungberg 381a6a999b Fixed a bad var statement in CPDecimal. Cleanup. 2010-11-17 21:58:58 -03:00
Klaas Pieter Annema 8e3e15080b made CPDecimalCreateWithString work with empty string 2010-05-06 14:13:29 +02:00
Klaas Pieter Annema 373210e610 fixed several global declarations of i in for loops 2010-05-05 12:13:24 +02:00
Stephen Ierodiaconou c79b2456f5 Some style changes to CPDecimal 2009-10-16 12:35:59 +01:00
stevegeek 00532fe7ac First CPDecimal and CPDecimalNumber commits (and tests).
These implementations are mostly complete but require optimisation.
2009-09-28 13:59:18 +01:00