warning: number_format() expects parameter 1 to be double, string given in I have migrated a site from one host to another and I now get the following warning:


  warning: number_format() expects parameter 1 to be double, string given in /var/www/vhosts/vinylletters.biz/httpdocs/modules/uc_font_attribute/uc_font_attribute.module on line 74.


Line 74 is the following.

$html .= '&lt;div class="font-block-url-'.$key.'"&gt;&lt;span class="font-url"&gt;'.$fontValue-&gt;fontValue.'&lt;/span&gt;&lt;span class="preview-url"&gt;'.str_replace('.ttf','.png',$fontValue-&gt;fontValue).'&lt;/span&gt;&lt;span class="extra-price"&gt;'.number_format($fontValue-&gt;price,2,'.','').'&lt;/span&gt;&lt;/div&gt;';


I am not sure what I need to do to get this line working.
The number_format() function requires a float type variable for its first parameter.

Try casting the parameter like this:

$html .= '&lt;div class="font-block-url-'.$key.'"&gt;&lt;span class="font-url"&gt;'.$fontValue-&gt;fontValue.'&lt;/span&gt;&lt;span class="preview-url"&gt;'.str_replace('.ttf','.png',$fontValue-&gt;fontValue).'&lt;/span&gt;&lt;span class="extra-price"&gt;'.number_format((float)($fontValue-&gt;price),2,'.','').'&lt;/span&gt;&lt;/div&gt;';