• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Implemented European Decimal Odds display

Bob

Developer
Staff member
per this non bug: http://addons.nfljunkies.com/threads/decimal-odds.97/

An option to display European Decimal Odds vs American Decimal Odds is in the works and should be included in the next release. This is purely a "display" issue. It has absolutely no "functionality" associated with it.

In the mean time, here is a temp solution for those wanting to display European Decimals Odds vs American.

===================
You will need to replace 3 methods in 2 different models. The 2 models are Wager.php (1 method) and Outcome.php (2 methods).

The first Model we'll do is Wager.php. The Model is located at the path below.

/library/NFLJ/Sportsbook/Model/Wager.php

The method we are going to replace is wager::formatWagerOdds (located on appx line 370)

Find this:
PHP:
    public function formatWagerOdds($wagers)
    {
        foreach ($wagers AS &$wager)
        {
            $wager['wager_odds_decimal'] = sprintf("%0.2f", ((float)$wager['wager_odds_against']/(float)$wager['wager_odds_for']));
        }
 
        return $wagers;       
    }

Replace with this:
PHP:
    public function formatWagerOdds($wagers)
    {
        foreach ($wagers AS &$wager)
        {
            $wager['wager_odds_decimal'] = sprintf("%0.2f", ((float)$wager['wager_odds_against']/(float)$wager['wager_odds_for'])+1.00);
        }
 
        return $wagers;       
    }



Next we'll do Outcome.php. The Model is located at the path below.

/library/NFLJ/Sportsbook/Model/Outcome.php

The first method we are going to replace is outcome::formatOutcomeOdds (located on appx line 75)

Find this:
PHP:
    public function formatOutcomeOdds($outcome)
    {
        $outcome['current_odds_decimal'] = sprintf("%0.2f", ((float)$outcome['current_odds_against']/(float)$outcome['current_odds_for']));
 
        return $outcome;       
    }

Replace with:
PHP:
    public function formatOutcomeOdds($outcome)
    {
        $outcome['current_odds_decimal'] = sprintf("%0.2f", ((float)$outcome['current_odds_against']/(float)$outcome['current_odds_for'])+1.00);
 
        return $outcome;       
    }



The second method we are going to replace is outcome::formatOutcomesOdds (located on appx line 83)

Find this:
PHP:
    public function formatOutcomesOdds($outcomes)
    {
        foreach ($outcomes AS &$outcome)
        {
            $outcome['current_odds_decimal'] = sprintf("%0.2f", ((float)$outcome['current_odds_against']/(float)$outcome['current_odds_for']));
        }
 
        return $outcomes;       
    }

Replace with this:
PHP:
    public function formatOutcomesOdds($outcomes)
    {
        foreach ($outcomes AS &$outcome)
        {
            $outcome['current_odds_decimal'] = sprintf("%0.2f", ((float)$outcome['current_odds_against']/(float)$outcome['current_odds_for'])+1.00);
        }
 
        return $outcomes;       
    }
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
Thank you Bob! Works great.

Another thing for european is the payout. usually the payout includes the money you've bet.

example:
I bet 10€ at 1,5 the payout visualized is 15€ and not 5€.

take a note for the next release ;)
 
That isn't a "European" standard, that is a personal preference. A "Stake" is NOT part of "Winnings" and "Winnings" is what is displayed (not Winnings + Stake return). I've had this discussion over and over and over for the past 10 years with this addon and with vBookie. The correct way to display "winnings" is without the stake return as the stake is yours to begin with....you didn't "win" it, you just didn't lose it. Its like a "deposit", if you WIN you get it back, it you lose, you don't.

This one yer on your own with as far as customizing it yourself or can request paid customization. I am more than willing to do paid customization (and I know a few others would probably chip in for this, like Rob Parker for one), just am not interested in adding this particular functionality to the core addon.
 
Yes, well I was thinking to a selectable view.

I know that what you're saying is right on you're longitude and in many other places, but you've to take my suggetsions as an help to enlarge you're customer base letting people with different habit to feel like home. But Bob, no problem! This are little things. ;)

p.s. I'm going send you the Italian translation when will be done at 100%
 
Back
Top