PHP String to Float

前端 未结 8 1260
别跟我提以往
别跟我提以往 2020-11-28 05:37

I am not familiar with PHP at all and had a quick question.

I have 2 variables pricePerUnit and InvoicedUnits. Here\'s the code that is set

8条回答
  •  迷失自我
    2020-11-28 05:46

    $rootbeer = (float) $InvoicedUnits;
    

    Should do it for you. Check out Type-Juggling. You should also read String conversion to Numbers.

提交回复
热议问题