Example #1

var min = 100;
var max = 1000;

$('#test1').nutritionLabel({
	'itemName' : 'Demo FDA Rounding Off',
	'showPotassium' : true,

	'valueServingWeightGrams' : Math.floor((Math.random() * max) + min) * .1,
	'valueServingPerContainer' : Math.floor((Math.random() * max) + min) * .1,
	'valueCalories' : Math.floor((Math.random() * max) + min) * .1,
	'valueFatCalories' : Math.floor((Math.random() * max) + min) * .1,
	'valueTotalFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueSatFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueTransFat' : Math.floor((Math.random() * max) + min) * .1,
	'valuePolyFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueMonoFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueCholesterol' : Math.floor((Math.random() * max) + min) * .1,
	'valueSodium' : Math.floor((Math.random() * max) + min) * .1,
	'valuePotassium' : Math.floor((Math.random() * max) + min) * .1, //this is for the legacy version
	'valuePotassium_2018' : Math.floor((Math.random() * max) + min) * .1, //this is for the 2018 version
	'valueTotalCarb' : Math.floor((Math.random() * max) + min) * .1,
	'valueFibers' : Math.floor((Math.random() * max) + min) * .1,
	'valueSugars' : Math.floor((Math.random() * max) + min) * .1,
	'valueAddedSugars' : Math.floor((Math.random() * max) + min) * .1,
	'valueProteins' : Math.floor((Math.random() * max) + min) * .1,
	'valueVitaminA' : Math.floor((Math.random() * max) + min) * .1,
	'valueVitaminC' : Math.floor((Math.random() * max) + min) * .1,
	'valueVitaminD' : Math.floor((Math.random() * max) + min) * .1,
	'valueCalcium' : Math.floor((Math.random() * max) + min) * .1,
	'valueIron' : Math.floor((Math.random() * max) + min) * .1
});



Example #2

var min = 100;
var max = 1000;

$('#test2').nutritionLabel({
	'itemName' : 'Demo FDA Rounding On',
	'allowFDARounding' : true,
	'showPotassium' : true,

	'valueServingWeightGrams' : Math.floor((Math.random() * max) + min) * .1,
	'valueServingPerContainer' : Math.floor((Math.random() * max) + min) * .1,
	'valueCalories' : Math.floor((Math.random() * max) + min) * .1,
	'valueFatCalories' : Math.floor((Math.random() * max) + min) * .1,
	'valueTotalFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueSatFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueTransFat' : Math.floor((Math.random() * max) + min) * .1,
	'valuePolyFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueMonoFat' : Math.floor((Math.random() * max) + min) * .1,
	'valueCholesterol' : Math.floor((Math.random() * max) + min) * .1,
	'valueSodium' : Math.floor((Math.random() * max) + min) * .1,
	'valuePotassium' : Math.floor((Math.random() * max) + min) * .1, //this is for the legacy version
	'valuePotassium_2018' : Math.floor((Math.random() * max) + min) * .1, //this is for the 2018 version
	'valueTotalCarb' : Math.floor((Math.random() * max) + min) * .1,
	'valueFibers' : Math.floor((Math.random() * max) + min) * .1,
	'valueSugars' : Math.floor((Math.random() * max) + min) * .1,
	'valueAddedSugars' : Math.floor((Math.random() * max) + min) * .1,
	'valueProteins' : Math.floor((Math.random() * max) + min) * .1,
	'valueVitaminA' : Math.floor((Math.random() * max) + min) * .1,
	'valueVitaminC' : Math.floor((Math.random() * max) + min) * .1,
	'valueVitaminD' : Math.floor((Math.random() * max) + min) * .1,
	'valueCalcium' : Math.floor((Math.random() * max) + min) * .1,
	'valueIron' : Math.floor((Math.random() * max) + min) * .1
});