Closed (fixed)
Project:
Rules
Version:
6.x-1.2
Component:
Rules Engine
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2010 at 18:20 UTC
Updated:
21 May 2010 at 10:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
fagoString token support has been recently added. I'm not sure whether numbers work though. If that's missing, reopen as feature request.
Comment #2
fizk commentedRenamed the subject, and leaving as active.
Comment #3
fizk commentedComment #4
colin49 commentedI ran into this issue as well. I've attached a patch which adds token replacement for the number rules data type.
Comment #5
colin49 commentedComment #7
colin49 commentedResubmitting patch this time created from the module's root folder (oops).
Comment #8
fagothanks, I improved the labels a bit and committed it.
Comment #9
colin49 commentednp - thanks for accepting the patch.
Comment #10
fizk commentedNice :) I have one question, why is the number cast to a float without checking if it is a float?
Comment #11
colin49 commentedHey fizk, good point. In fact it probably makes sense to leave out the cast completely. What do you think?
Comment #12
fizk commentedI agree, let's take it out. Thanks for the patch!
Comment #13
colin49 commentedI've attached a second patch with the float cast removed. Sorry about that fizk / fago!
Comment #15
fagoI do think the cast is fine - it just makes sure it is a number in case it isn't. Let's keep it.
Comment #16
fizk commentedBut why float? Why not use http://php.net/manual/en/function.intval.php or sprintf("%d"), or something else. A straight cast to float with no checks pretty random.