[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

numberformat coverting a variable containing 1,000 to a variable containing 1000

Hey folks,

A quick question to ask how i should:

pass a variable (number) in the url
extract it on another page and save it to a variable
do a database search on this variable and then bring back the details

My application works when the number is less than 1000 but once it gets to 1000 or more it trys to do a search on the database where ID = 1,234.

I have tried to convert this to  #numberformat(variable, 9999)# but it converts it to a random number somehow,

Any help would be much appreciated.

Cheers
0
jturkington
Asked:
jturkington
  • 2
2 Solutions
 
mosphatCommented:
Apparently you use formatting like 1,000 and your database needs it to be 1000. You can achieve that using #lsParseNumber(variable)#. Provided the locale is set to one that understands 1,000 (Like English (US))
0
 
kkhippleCommented:
As mosphat pointed out you would use LsParseNumber liek so

LSParseNumber - http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functa38.htm#wp1109542
#LSParseNumber(LSNumberFormat(1234.5678, "_________"))#


you can also use numberformat to format the number to a certain locale but that's probably not what you are looking for
LSNumberFormat - http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functa34.htm#wp1109042
0
 
jturkingtonAuthor Commented:
Thanks guys that done the trick !
0
 
kkhippleCommented:
Glad I could help

cheers,
KDK
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now