Results 1 to 2 of 2

Thread: Variables past the decimal

  1. #1
    Join Date
    Feb 2007
    Thanked 1 Time in 1 Post

    Default Variables past the decimal

    Ok this might be a stupid question, but is it possible to use a variable in a number with decimals past the decimal point

    For example:
    $B='5.46'.$A.'742'; \\Or the following

    Obviously that wont work (At least I dont think it wont, it makes no sense) but you get the general idea of what I am trying to do.
    Last edited by Demonicman; 01-06-2015 at 05:37 AM. << bored? check out ma game

  2. #2
    Join Date
    Jul 2008
    Derbyshire, UK
    Thanked 599 Times in 575 Posts
    Blog Entries


    The last example would need to be
    $B = "5.46$A742";
    which would turn it from an integer (number) into a string - although PHP is loosely typed and whether it's an integer or string is determined by context, so you'd be able to use $B in a mathematical equation.

    Your question isn't really clear to me but you can read more about type casting here
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. The Following User Says Thank You to Beverleyh For This Useful Post:

    Demonicman (01-05-2015)

Similar Threads

  1. Add code for decimal places
    By rhodarose in forum PHP
    Replies: 2
    Last Post: 11-22-2010, 02:33 AM
  2. String to decimal...
    By ??? in forum JavaScript
    Replies: 5
    Last Post: 01-04-2009, 08:42 PM
  3. binary to decimal / Palindromes
    By leonidassavvides in forum Java
    Replies: 3
    Last Post: 10-07-2008, 04:19 AM
  4. Binary/Hex/Decimal Script - Help
    By magicyte in forum JavaScript
    Replies: 5
    Last Post: 07-05-2008, 01:15 AM
  5. Decimal vs. Hex
    By techno_race in forum HTML
    Replies: 9
    Last Post: 04-28-2007, 07:03 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts