Multiply result

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
sweborn
Posts: 12
Joined: 2007-10-17 23:16:52

Multiply result

Post by sweborn »

How multiply i the result value of a customer rating. I want the result showing the double sum. The reason is that discshop's (discshop.se) ratings are between 1 and 5 and in AMC is the highest value 10.

Code: Select all

// Rating
  if CanSetField(fieldRating) then
  begin
    Value := TextBetween(PageText, 'Kundbetyg:', '<br>');
    Value := TextBetween(Value , '<b>', '</b>');
    SetField(fieldRating, Value);
  end;
sweborn
Posts: 12
Joined: 2007-10-17 23:16:52

Post by sweborn »

I found the solution.

Code: Select all

// Rating
  if CanSetField(fieldRating) then
  begin
    Value := TextBetween(PageText, 'Kundbetyg:', '<br>');
    Value := TextBetween(Value , '<b>', '</b>');
    SetField(fieldRating, FloatToStr(StrToFloat(Value)*2));
  end;
Post Reply