word function problem with decimal values

4 views
Skip to first unread message

Carlo smussi

unread,
Nov 7, 2022, 1:04:19 PM11/7/22
to netlogo-users
I'm having a problem with the following code.In the interface there is a monitor that shows the actual money of an agent, but with the function word it shows to me all the decimal places possible (I inserted 2, but seems it doesn't care). The code is inside the monitor's reporter, and it is this " word "$" sum [money] of people. Thanks in advance.

John Chen

unread,
Nov 7, 2022, 1:17:53 PM11/7/22
to Carlo smussi, netlogo-users
Where is the following code? Thanks.

On Mon, Nov 7, 2022 at 12:04 PM Carlo smussi <marion...@gmail.com> wrote:
I'm having a problem with the following code.In the interface there is a monitor that shows the actual money of an agent, but with the function word it shows to me all the decimal places possible (I inserted 2, but seems it doesn't care). The code is inside the monitor's reporter, and it is this " word "$" sum [money] of people. Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/55c3d6b1-0878-4092-b246-9d583a84c15an%40googlegroups.com.

Christopher Ruebeck

unread,
Nov 7, 2022, 1:22:07 PM11/7/22
to netlogo-users
You’ve created a string, so telling the monitor a number of decimal places won’t help. Instead, you’ll need to use the precision reporter on the number. For two decimal places: word “$” precision sum [money] of people 2
Reply all
Reply to author
Forward
0 new messages