This morning, President Obama visited a Costco in suburban Maryland to reemphasize the theme of income inequality he sounded in the State of the Union speech last night. Our calculator shows why Obama chose the home of the giant pickle jar and behemoth TP package: Even at the relatively low wages paid by big-box retailers, slightly better pay can mean the difference between inescapable poverty and a modest living.

How many people are in your household? One Adult No Children One Adult One Child One Adult Two Children One Adult Three Children Two Adults No Children Two Adults One Child Two Adults Two Children Two Adults Three Children Which state do you live in? Which area do you live in? (Area data not available for households without children.) Where you live, a Costco worker needs to work __ hours each week to make a secure yet modest living to support a family as big as yours (as a sole breadwinner). A WalMart worker would need to work __ hours a week to achieve the same. Sources: CNN Money, The National Employment Law Project, Bureau of Labor Statistics, and Economic Policy Institute’s Family Budget Calculator. The annual costs of living for adults without children use state-wide averages from MIT’s Living Wage Calculator. Front page image: Ruaridh Stewart/ZUMA Press.

var first_state = 'AK'; var first_locale = 'Anchorage, AK HUD Metro FMR Area'; var state_abbr = { 'AL' : 'Alabama', 'AK' : 'Alaska', 'AS' : 'America Samoa', 'AZ' : 'Arizona', 'AR' : 'Arkansas', 'CA' : 'California', 'CO' : 'Colorado', 'CT' : 'Connecticut', 'DE' : 'Delaware', 'DC' : 'District of Columbia', 'FM' : 'Micronesia1', 'FL' : 'Florida', 'GA' : 'Georgia', 'GU' : 'Guam', 'HI' : 'Hawaii', 'ID' : 'Idaho', 'IL' : 'Illinois', 'IN' : 'Indiana', 'IA' : 'Iowa', 'KS' : 'Kansas', 'KY' : 'Kentucky', 'LA' : 'Louisiana', 'ME' : 'Maine', 'MH' : 'Islands1', 'MD' : 'Maryland', 'MA' : 'Massachusetts', 'MI' : 'Michigan', 'MN' : 'Minnesota', 'MS' : 'Mississippi', 'MO' : 'Missouri', 'MT' : 'Montana', 'NE' : 'Nebraska', 'NV' : 'Nevada', 'NH' : 'New Hampshire', 'NJ' : 'New Jersey', 'NM' : 'New Mexico', 'NY' : 'New York', 'NC' : 'North Carolina', 'ND' : 'North Dakota', 'OH' : 'Ohio', 'OK' : 'Oklahoma', 'OR' : 'Oregon', 'PW' : 'Palau', 'PA' : 'Pennsylvania', 'PR' : 'Puerto Rico', 'RI' : 'Rhode Island', 'SC' : 'South Carolina', 'SD' : 'South Dakota', 'TN' : 'Tennessee', 'TX' : 'Texas', 'UT' : 'Utah', 'VT' : 'Vermont', 'VI' : 'Virgin Island', 'VA' : 'Virginia', 'WA' : 'Washington', 'WV' : 'West Virginia', 'WI' : 'Wisconsin', 'WY' : 'Wyoming' }

var selected_state = jQuery("#selected_state"); var selected_locale = jQuery("#selected_locale"); var selected_household = jQuery("#selected_household");

for (var state in bfjo) { var option = jQuery(' ' + state_abbr[state] + ''); selected_state.append(option); }

var fill_locale_selector = function(state_object) {

selected_locale.html("");

for (var locale in state_object) { var option = jQuery(' ' + locale.replace(/,.*$/, '') + ''); selected_locale.append(option); } }

fill_locale_selector(bfjo[first_state])

selected_state.bind("change", function() { var state = $("#selected_state option:selected").val(); var state_object = bfjo[state];

fill_locale_selector(state_object);

} )

selected_locale.bind("change", function() { var state = $("#selected_state option:selected").val(); var locale = $("#selected_locale option:selected").val(); var locale_object = bfjo[state][locale]; } )

enable_disable_locale = function() { var household = $("#selected_household option:selected").val();

if (household === '1P0C' || household === '2P0C') { selected_locale.attr('disabled', 'disabled'); } else { selected_locale.removeAttr('disabled'); } } selected_household.bind("change", function() { enable_disable_locale(); } ); enable_disable_locale();

jQuery("#calculate_this").bind("submit", function() {

var state = $("#selected_state option:selected").val(); var locale = $("#selected_locale option:selected").val(); var household = $("#selected_household option:selected").val();

var hours_worked_per_year = 2080; var walmart_hourly_salary = 9.4; var walmart_annual_salary = walmart_hourly_salary * hours_worked_per_year; var costco_hourly_salary = 22.8; var costco_annual_salary = costco_hourly_salary * hours_worked_per_year;

var annual_living_wage_for_household = bfjo[state][locale][household];

var walmart_hours_needed_per_year = annual_living_wage_for_household / walmart_hourly_salary; var costco_hours_needed_per_year = annual_living_wage_for_household / costco_hourly_salary;

var walmart_hours_needed_per_week = walmart_hours_needed_per_year / 52; var costco_hours_needed_per_week = costco_hours_needed_per_year / 52;

console.log('Walmart hours per week: ', walmart_hours_needed_per_week) console.log('Costco hours per week: ', costco_hours_needed_per_week)

var commify = function(number) { while (/(d+)(d{3})/.test(number.toString())){ number = number.toString().replace(/(d+)(d{3})/, '$1'+','+'$2'); } return number; }

jQuery("#calculated").show(); jQuery("#costco_hours_needed_per_week").text(Math.round(costco_hours_needed_per_week)); jQuery("#walmart_hours_needed_per_week").text(Math.round(walmart_hours_needed_per_week));

//var salary_string = commify(salary); //var yearly_living_wage_string = commify(annual_living_wage); /* while (/(d+)(d{3})/.test(salary_string.toString())){ salary_string = salary_string.toString().replace(/(d+)(d{3})/, '$1'+','+'$2'); } while (/(d+)(d{3})/.test(yearly_living_wage_string.toString())){ yearly_living_wage_string = yearly_living_wage_string.toString().replace(/(d+)(d{3})/, '$1'+','+'$2'); } */

/*console.log(hourly_for_living); var hourly_for_living_clean = Math.round(hourly_for_living * 100) .toString().replace(/(d+)(d{2})/, '$1'+'.'+'$2');

jQuery("#living_wage_hourly").text(hourly_for_living_clean);*/

return false;

}

)