SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Uk
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Basket String Formatting?

    Hi

    I am going out of my mind... I think it's Friday syndrome...

    I need to convert a string back into values... I can use to format a table...

    Code:
    <cfset amount = 28.81>
    <cfset postage = 4.95>
    <cfset basket = "3:Sony SV-234 DVD Player:1:170.20:29.79:199.99:199.99:The Fast and The Furious Region 2 DVD:2:17.01:2.98:19.99:39.98:Delivery:1:4.99:----:4.99:4.99">
    I've tried rereplace... but it doesn't end up looking like..

    Code:
    Items  	Quantity  	Item value  	Item Tax  	Item Total  	Line Total
    Sony SV-234 DVD Player 	1 	170.20 	29.79 	199.99 	199.99
    The Fast and The Furious Region 2 DVD 	2 	17.01 	2.98 	19.99 	39.98
    Delivery 	1 	4.99 	---- 	4.99 	4.99
    I want to be able to at the very least reference each cell...

    What do I do... at this point in time I have no idea...

    All the values are using : as a seperator..

    The First number (could be up to 3 digits...) this is the number of lines in the form...

    Then it goes... ItemName, Qty, Price, Item Tax, Line Total for each item....

    For postage there is no tax so this is ----

    Each cell is not fixed in size.... sometimes long... sometimes short..

    This is driving me mad - can anyone help me?


  2. #2
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,096
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Have you tried #(Gettoken,x,":")# where x is the position of the item you need the value for?

    You might also be able to use ListToArray()


Bookmarks

Posting Permissions

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