User Profile

Collapse

Profile Sidebar

Collapse
bonneylake
bonneylake
Joined: Aug 11 '08
Location: United States
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hey Acoder,

    That worked perfectly! I am glade i asked you because some of the values actually have -1 and have a lowest price to choose from so its a good thing we changed it .Other wise they would get -1 for the ones with no lowest cost and then some that have a lowest price with -1.But i cant think of any other questions to ask so i guess this topic is closed. But Thank You again for all your help!!!!

    Thank you,Thank...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    I looked through the whole code, but no where does it have -1, unless i am missing it. Here is what i have in full.

    Code:
    <table width="85%" align="center">
    <thead>
    <tr>
    <th>HC Part Number</th>
    <th>Manu Part Number </th>
    <th>MPL manufacturer</th>
    <th>MPL LastBuyQuote</th>
    <th>Techdata
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Almost i got one more question i want to ask in case the people i made the report want this changed. How would i change the part where -1 appears when all 3 prices don't have a price for a particular part?i tried to change it but i am not even sure where the -1 comes from. i know its from the code below but not sure how it appears.Thought 0 would appear if none of them had a price.

    Code:
     <cfset lowest = 0>
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,


    Well when i asked boss if he wanted it to be like 0.39 he wrote me back saying .039 should be fine so i guess either a) he put the decimal in wrong place or b) i got confused and he wants it as 0.39.An yeah it is high numbers i agree. Not sure why they didn't just type them in there rounded.but your suggestion worked perfectly. Thank you so much for all the help you have no idea how much i appreciate it :)
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Asked boss and he said do it as .039 instead of the other idea we had. So would
    #DecimalFormat( Pricediff)# work? when i tried it that way (decimal format) i got -.39 and i was excepting a 0 in front of the 3 so just wondering if this would be correct way to do it or not?

    Thank you,
    Rach
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    My last question (i hope is my last) is instead of displaying the round as your example how would i display it as .039 instead of how it originally was which was 0.394784718011 ? would something like #decimalFormat( Pricediff)# work?

    here is what i got in total code wise now.

    Code:
    <cfset cost = #acompare.cost#>
    <cfif IsNumeric(cost) and #val(cost)# neq 0.0>
    <cfset pricediff
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    So is this the correct way to do the round? because mine didn't display like 3.25% it instead just kept putting first number 0. This is how i did it.

    Code:
    #Round(pricediff * 100)#
    Thank you,
    Rach
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Do you think they would want to see just the rounded number or see 0.03? They say % price different so i am thinking the 0.03, but i don't know how i just display the 0.03.

    An also wanted to make sure, the if one value is -0.04 then it means its lower then 3 percent right?

    An the last question i am a bit confused on how to show the + would i just do <cfif
    pricediff gt 0.03 > +...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Ok so i changed it to an or and now if a number if its greater than 3% it will show 0.04. An anything below 0.03 it shows n/a is this correct?

    there is a few parts i am confused on. One value has - 0.39 and the other is 0.03 (one negative one positive). If you could explain what that means for one to be negative and one to be positive it would be helpful because it has me a bit off

    another...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    I tried the following, but it still says all of the costs are n/a an that don't make sinse based on the math, especially for record 292 because when i do that one i get a value of 0.04.

    Code:
    <cfset cost = #acompare.cost#>
    <cfif IsNumeric(cost) and #val(cost)# neq 0.0>
    <cfset pricediff = ((#lowest# - cost)/cost)>
    <cfif pricediff gt 0.03 and pricediff lt -0.03>
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Around which cost? the one in isnumeric, the one where cost neq 0.0, the cost's in the pricediff? an then should i still be outputting using #pricediff#?

    Thank you,
    Rach
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    I know the neq 0 part is failing,because the isnumeric was working before. But cost is a float field in the table, not sure if its a string or not. Just know its float.

    But i took out the cost neq 0 to make sure it was causing it and turns out its me using #pricediff# to output it is causing the problem. Its saying n/a for all of them based on i changed #cost# to pricediff#.Any suggestions?

    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    I tried it the way i had it and tried it your way an now all the values for the price diff say n/a. I think its cause when you do the price diff at the beginning of all of them they had 0.0 in front? Any suggestions?

    Code:
    <cfset cost = #acompare.cost#>
    <cfif IsNumeric(cost) and cost neq 0>
    <cfset pricediff = ((#lowest# - cost)/cost)>
    <cfif pricediff gt 0.03 and pricediff
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    So would this be correct? not sure if i got the cost neq in the right spot or not. not sure if it should be before or after isnumeric

    Code:
    <cfset cost = #acompare.cost#>
    <cfif IsNumeric(cost)>
    <cfif cost neq 0>
    <cfset pricediff = ((#lowest# - cost)/cost)>
    <cfif pricediff gt 0.03 and pricediff lt -0.03>
    #pricediff#
    <cfelse>
    N/A
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Definately want to output the price different so instead of using #cost# would i use #pricediff#?. Line 194 and 292 appear in the report.used them because there the first 2 that have something in the price diff column an my bad its 16.49 (typed it wrong).

    So would this be correct?

    Code:
    <cfset cost = #acompare.cost#>
    <cfif IsNumeric(cost)>
    <cfset pricediff = ((#lowest#
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,


    Actually doing this seemed to help. I am not getting errors anymore an now some of the values are 0 and some are not.But i am not sure if this is the correct solution or not.

    Code:
    <cfset cost = #acompare.cost#>
    <cfif IsNumeric(cost)>
    <cfset pricediff = ((#lowest# - cost)/cost)>
    <cfif pricediff gt 0.03>
    #cost#
    <cfelseif pricediff lt -0.03>
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    According to what i am looking at, there both outputting numbers. Its getting the correct value for the lowest company by doing #lowest# and when i do the cost, the cost is matching up correctly and its a number as well by doing #acompare.Cost# . But i know cost is a float and the company price is numeric, i don't know if that makes a difference or not as to why the pricediff wont work.

    i know the problem...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Confused on what you mean Check the values of cost and lowest? just output them like #acompare.cost# output it an then change it from that to #lowest# and output it? bit confused on how to check.

    so everyone on one line should be something like this?

    Code:
    <cfset cost = #acompare.cost#>
    <cfset pricediff = ((#lowest# - cost)/cost)>
    <cfif pricediff gt 0.03 and pricediff
    ...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    So would something like this be correct? or does the pricediff gt and lt need to be on the same line?

    Code:
    <cfset cost = #acompare.cost#>
    <cfset pricediff = ((#lowest# - cost)/cost)>
    <cfif pricediff gt 0.03>
    #cost#
    <cfelseif pricediff lt -0.03>
    0
    </cfif>
    also i am getting an error saying

    An error occurred while...
    See more | Go to post

    Leave a comment:


  • Hey Acoder,

    Don't think i got this right. Am i suppose to be using lowest for the gt or lt or am i suppose to be using pricediff?An i am getting and error with the ) it says Invalid parser construct

    Code:
    <cfset cost = #acompare.cost#>
    <cfset pricediff = (#lowest# - cost)/cost)>
    <cfif lowest gt 0.03 or lowest lt -0.03>
    #cost#
    <cfelse>
    0
    </cfif>
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...