OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Combined Variable

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Combined Variable
Page: [1]
 
chadb

 

Posts: 501
From: Kansas
Status: offline

 
Combined Variable - 8/17/2009 11:57:58   
How can I combine a variable the is numeric to a text? Example I have a varibe mynum which has a value of 4 and I want to add "hrs" to it.

I have tried mynum = mynum + "hrs"

TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Combined Variable - 8/17/2009 12:39:10   
You cannot add string variables. If you pass two variables "4" and "5" as strings and then try to add Like this: 4+5 then you simply get the two variables next to one another in the results like this: 45.
You need to convert the string to a numeral using cint().

_____________________________

:)

Follow us on TWITTER

(in reply to chadb)
ou812

 

Posts: 1705
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: Combined Variable - 8/17/2009 12:41:55   
Not sure why you would want to do that, but if so you should be able to do this:
mynum = mynum & " hrs"

Or maybe you're looking to just display it with hours?
response.write mynum & " hrs"

_____________________________

-brian

Black Holes suck.

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to chadb)
chadb

 

Posts: 501
From: Kansas
Status: offline

 
RE: Combined Variable - 8/17/2009 13:05:37   
What is the way to covert a numeric to text?

(in reply to ou812)
swoosh

 

Posts: 1535
Joined: 5/18/2002
From: Beaver Falls, PA
Status: offline

 
RE: Combined Variable - 8/17/2009 13:13:31   
quote:

What is the way to covert a numeric to text?


CStr

_____________________________

Swoooosh
Just Do It!


(in reply to chadb)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Combined Variable
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts