|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
decimal problems
hi there i have a script that calculates a value but when the
value is for example 5.40 the textbox displays it as 5.4 because this is a money value it has to have the "0" at the end how can i make the script so that it always has 2 decimals behind the comma or point.... here is the script <% Dim strfoto1 if (orders.Fields.Item("aantal").Value) = 1 then strfoto1 = (kostprijs.Fields.Item("kosten").Value) * (orders.Fields.Item("aantal").Value) + 1.80 ElseIf (orders.Fields.Item("aantal").Value) Mod 2 = 1 then strfoto1 = ((kostprijs.Fields.Item("kosten").Value) + 0.25) * (orders.Fields.Item("aantal").Value) + 0.10 + 1.80 else strfoto1 = ((kostprijs.Fields.Item("kosten").Value) + 0.25) * (orders.Fields.Item("aantal").Value) + 1.80 end if %> <input type="text" name="textfield2" value="<%=strfoto1%>" readonly> thanks for youre help greetz Sander |
|
#2
|
|||
|
|||
|
formatNumber(strfoto1, 2)
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > decimal problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|